[Android] AudioMiniPlayer: no need for a SeekBar here

Ludovic Fauvet git at videolan.org
Fri Oct 12 16:49:17 CEST 2012


vlc-ports/android | branch: master | Ludovic Fauvet <etix at videolan.org> | Fri Oct 12 16:38:38 2012 +0200| [06fe6b74759ad57bc982667f2858a6788402ea2c] | committer: Ludovic Fauvet

AudioMiniPlayer: no need for a SeekBar here

As we don't allow interaction with the widget a ProgressBar is enough
here.

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=06fe6b74759ad57bc982667f2858a6788402ea2c
---

 vlc-android/res/layout/audio_player_mini.xml                 |    6 ++++--
 vlc-android/src/org/videolan/vlc/widget/AudioMiniPlayer.java |   10 +++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/vlc-android/res/layout/audio_player_mini.xml b/vlc-android/res/layout/audio_player_mini.xml
index 47ce943..e50ebf4 100644
--- a/vlc-android/res/layout/audio_player_mini.xml
+++ b/vlc-android/res/layout/audio_player_mini.xml
@@ -6,14 +6,16 @@
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:background="@drawable/bg_with_shadow">
-    <SeekBar
+    <ProgressBar
+        style="@android:style/Widget.ProgressBar.Horizontal"
         android:id="@+id/timeline"
         android:layout_height="wrap_content"
         android:layout_width="fill_parent"
         android:minHeight="2dip"
         android:maxHeight="2dip"
         android:progressDrawable="@drawable/po_seekbar"
-        android:thumb="@drawable/spacer"
+        android:focusable="false"
+        android:indeterminate="false"
         android:paddingLeft="0px"
         android:paddingRight="0px" />
     <LinearLayout
diff --git a/vlc-android/src/org/videolan/vlc/widget/AudioMiniPlayer.java b/vlc-android/src/org/videolan/vlc/widget/AudioMiniPlayer.java
index 1087fdb..6c2bcb6 100644
--- a/vlc-android/src/org/videolan/vlc/widget/AudioMiniPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/widget/AudioMiniPlayer.java
@@ -40,7 +40,7 @@ import android.view.ViewGroup;
 import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
-import android.widget.SeekBar;
+import android.widget.ProgressBar;
 import android.widget.TextView;
 
 public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
@@ -55,7 +55,7 @@ public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
     private ImageButton mForward;
     private ImageButton mBackward;
     private ImageView mCover;
-    private SeekBar mSeekbar;
+    private ProgressBar mProgressBar;
 
     // Listener for the play and pause buttons
     private final OnClickListener onMediaControlClickListener = new OnClickListener() {
@@ -99,7 +99,7 @@ public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
         mPlayPause.setOnClickListener(onMediaControlClickListener);
         mForward.setOnClickListener(onMediaControlClickListener);
         mBackward.setOnClickListener(onMediaControlClickListener);
-        mSeekbar = (SeekBar) v.findViewById(R.id.timeline);
+        mProgressBar = (ProgressBar) v.findViewById(R.id.timeline);
 
         LinearLayout root = (LinearLayout) v.findViewById(R.id.root_node);
 
@@ -189,8 +189,8 @@ public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
             int length = mAudioPlayerControl.getLength();
             // Update all view elements
 
-            mSeekbar.setMax(length);
-            mSeekbar.setProgress(time);
+            mProgressBar.setMax(length);
+            mProgressBar.setProgress(time);
         }
 
     }



More information about the Android mailing list