[Android] Enhance auto scroll

Geoffrey Métais git at videolan.org
Thu Jan 7 11:56:39 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan  7 11:56:22 2016 +0100| [f355fc5edff9bbb1b12c778daf8f296d306013d9] | committer: Geoffrey Métais

Enhance auto scroll

> https://code.videolan.org/videolan/vlc-android/commit/f355fc5edff9bbb1b12c778daf8f296d306013d9
---

 .../src/org/videolan/vlc/gui/audio/AudioPlayer.java      |  2 +-
 .../org/videolan/vlc/gui/video/VideoPlayerActivity.java  | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
index 742363f..1c310ca 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -441,7 +441,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
 
     @Override
     public void onSelectionSet(int position) {
-        mPlaylist.scrollToPosition(position);
+        mPlaylist.smoothScrollToPosition(position);
     }
 
     OnSeekBarChangeListener mTimelineListner = new OnSeekBarChangeListener() {
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 3acce90..b031cba 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2112,14 +2112,14 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             mPlaylistAdapter.notifyItemRangeChanged(0, count);
 
         final int selectionIndex = currentIndex;
-        if (!previousAudioList.equals(playlist))
-            mPlaylist.post(new Runnable() {
-                @Override
-                public void run() {
-                    mPlaylistAdapter.setCurrentIndex(selectionIndex);
-                }
-            });
-    }
+        mPlaylist.post(new Runnable() {
+            @Override
+            public void run() {
+                mPlaylistAdapter.setCurrentIndex(selectionIndex);
+                mPlaylist.scrollToPosition(selectionIndex);
+            }
+        });
+}
 
     @Override
     public void onSelectionSet(int position) {



More information about the Android mailing list