Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
dfaa4ef8
Commit
dfaa4ef8
authored
Nov 24, 2011
by
John Mooring
Committed by
Sébastien Toque
Nov 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added next and previous to mini player.
Signed-off-by:
Sébastien Toque
<
xilasz@gmail.com
>
parent
c227fb64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
10 deletions
+43
-10
vlc-android/res/layout/audio_player_mini.xml
vlc-android/res/layout/audio_player_mini.xml
+17
-4
vlc-android/src/org/videolan/vlc/android/widget/AudioMiniPlayer.java
.../src/org/videolan/vlc/android/widget/AudioMiniPlayer.java
+26
-6
No files found.
vlc-android/res/layout/audio_player_mini.xml
View file @
dfaa4ef8
...
...
@@ -36,7 +36,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/title"
android:textSize=
"
20
dip"
android:textSize=
"
16
dip"
android:textColor=
"#ffffff"
android:singleLine=
"true"
/>
<TextView
...
...
@@ -44,18 +44,31 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/artist"
android:textSize=
"1
6
dip"
android:textSize=
"1
4
dip"
android:textColor=
"#888888"
android:singleLine=
"true"
/>
</LinearLayout>
<ImageButton
android:id=
"@+id/backward"
android:src=
"@drawable/ic_backward"
android:background=
"#00ffffff"
android:scaleType=
"fitXY"
android:layout_width=
"30dip"
android:layout_height=
"60dip"
/>
<ImageButton
android:id=
"@+id/play_pause"
android:src=
"@drawable/ic_pause"
android:background=
"#00ffffff"
android:scaleType=
"fitXY"
android:layout_width=
"60dip"
android:layout_height=
"60dip"
/>
<ImageButton
android:id=
"@+id/forward"
android:src=
"@drawable/ic_forward"
android:background=
"#00ffffff"
android:scaleType=
"fitXY"
android:layout_width=
"30dip"
android:layout_height=
"60dip"
android:padding=
"10dip"
android:layout_marginRight=
"10dip"
/>
android:layout_marginRight=
"10dip"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
vlc-android/src/org/videolan/vlc/android/widget/AudioMiniPlayer.java
View file @
dfaa4ef8
...
...
@@ -28,18 +28,26 @@ public class AudioMiniPlayer extends LinearLayout implements AudioPlayer {
private
TextView
mTitle
;
private
TextView
mArtist
;
private
ImageButton
mPlayPause
;
private
ImageButton
mForward
;
private
ImageButton
mBackward
;
private
ImageView
mCover
;
private
SeekBar
mSeekbar
;
// Listener for the play and pause buttons
private
OnClickListener
on
PlayPause
ClickListener
=
new
OnClickListener
()
{
private
OnClickListener
on
MediaControl
ClickListener
=
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
mAudioPlayerControl
!=
null
)
{
if
(
mAudioPlayerControl
.
isPlaying
())
{
mAudioPlayerControl
.
pause
();
}
else
{
mAudioPlayerControl
.
play
();
if
(
v
==
mPlayPause
)
{
if
(
mAudioPlayerControl
.
isPlaying
())
{
mAudioPlayerControl
.
pause
();
}
else
{
mAudioPlayerControl
.
play
();
}
}
else
if
(
v
==
mForward
)
{
mAudioPlayerControl
.
next
();
}
else
if
(
v
==
mBackward
)
{
mAudioPlayerControl
.
previous
();
}
}
update
();
...
...
@@ -69,7 +77,11 @@ public class AudioMiniPlayer extends LinearLayout implements AudioPlayer {
mTitle
=
(
TextView
)
findViewById
(
R
.
id
.
title
);
mArtist
=
(
TextView
)
findViewById
(
R
.
id
.
artist
);
mPlayPause
=
(
ImageButton
)
findViewById
(
R
.
id
.
play_pause
);
mPlayPause
.
setOnClickListener
(
onPlayPauseClickListener
);
mForward
=
(
ImageButton
)
findViewById
(
R
.
id
.
forward
);
mBackward
=
(
ImageButton
)
findViewById
(
R
.
id
.
backward
);
mPlayPause
.
setOnClickListener
(
onMediaControlClickListener
);
mForward
.
setOnClickListener
(
onMediaControlClickListener
);
mBackward
.
setOnClickListener
(
onMediaControlClickListener
);
mSeekbar
=
(
SeekBar
)
findViewById
(
R
.
id
.
timeline
);
this
.
setOnClickListener
(
new
OnClickListener
()
{
...
...
@@ -140,6 +152,14 @@ public class AudioMiniPlayer extends LinearLayout implements AudioPlayer {
}
else
{
mPlayPause
.
setImageResource
(
R
.
drawable
.
ic_play
);
}
if
(
mAudioPlayerControl
.
hasNext
())
mForward
.
setVisibility
(
ImageButton
.
VISIBLE
);
else
mForward
.
setVisibility
(
ImageButton
.
INVISIBLE
);
if
(
mAudioPlayerControl
.
hasPrevious
())
mBackward
.
setVisibility
(
ImageButton
.
VISIBLE
);
else
mBackward
.
setVisibility
(
ImageButton
.
INVISIBLE
);
int
time
=
(
int
)
mAudioPlayerControl
.
getTime
();
int
length
=
(
int
)
mAudioPlayerControl
.
getLength
();
// Update all view elements
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment