[Android] Avoid invalid scroll

Geoffrey Métais git at videolan.org
Tue Feb 5 18:33:12 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb  5 18:29:57 2019 +0100| [232960333985c2e6f762695c44a33164bf0076d9] | committer: Geoffrey Métais

Avoid invalid scroll

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

 .../src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java     | 1 +
 1 file changed, 1 insertion(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
index 480787eb3..312f32a23 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
@@ -296,6 +296,7 @@ public class AudioPlayerActivity extends BaseTvActivity {
             @Override
             public void run() {
                 final int position = model.getCurrentMediaPosition();
+                if (position < 0) return;
                 mAdapter.setSelection(position);
                 int first = ((LinearLayoutManager)mBinding.playlist.getLayoutManager()).findFirstCompletelyVisibleItemPosition();
                 int last = ((LinearLayoutManager)mBinding.playlist.getLayoutManager()).findLastCompletelyVisibleItemPosition();



More information about the Android mailing list