[Android] Fix fastscroll not showing in Audio tabs when coming from another screen.
Nicolas Pomepuy
git at videolan.org
Wed Feb 13 16:15:59 CET 2019
vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Wed Feb 13 09:56:15 2019 +0100| [b1fca0ed68da536b7113c151c7ae79bc9c09ddbd] | committer: Geoffrey Métais
Fix fastscroll not showing in Audio tabs when coming from another screen.
> https://code.videolan.org/videolan/vlc-android/commit/b1fca0ed68da536b7113c151c7ae79bc9c09ddbd
---
vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java | 5 +++--
vlc-android/src/org/videolan/vlc/gui/view/FastScroller.kt | 4 ----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index 15f459233..d2a8b398e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -137,7 +137,8 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
};
mViewPager.setOffscreenPageLimit(MODE_TOTAL - 1);
mViewPager.setAdapter(new AudioPagerAdapter(mLists, titles));
- mViewPager.setCurrentItem(mSettings.getInt(Constants.KEY_AUDIO_CURRENT_TAB, 0));
+ final int tabPosition = mSettings.getInt(Constants.KEY_AUDIO_CURRENT_TAB, 0);
+ mViewPager.setCurrentItem(tabPosition);
final ArrayList<Integer> positions = savedInstanceState != null ? savedInstanceState.getIntegerArrayList(KEY_LISTS_POSITIONS) : null;
for (int i = 0; i< MODE_TOTAL; ++i) {
final LinearLayoutManager llm = new LinearLayoutManager(getActivity());
@@ -149,6 +150,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
}
mViewPager.setOnTouchListener(mSwipeFilter);
mSwipeRefreshLayout.setOnRefreshListener(this);
+ mFastScroller.setRecyclerView(mLists[tabPosition], models[tabPosition]);
}
@Override
@@ -269,7 +271,6 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
super.onTabSelected(tab);
mSettings.edit().putInt(Constants.KEY_AUDIO_CURRENT_TAB, tab.getPosition()).apply();
final Boolean loading = getViewModel().getLoading().getValue();
- mFastScroller.setRecyclerView(mLists[tab.getPosition()], models[tab.getPosition()]);
if (loading == null || !loading) mHandler.sendEmptyMessage(UNSET_REFRESHING);
else mHandler.sendEmptyMessage(SET_REFRESHING);
}
diff --git a/vlc-android/src/org/videolan/vlc/gui/view/FastScroller.kt b/vlc-android/src/org/videolan/vlc/gui/view/FastScroller.kt
index 61e5010b7..1575736f8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/view/FastScroller.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/view/FastScroller.kt
@@ -53,15 +53,11 @@ private const val TAG = "FastScroller"
private const val HANDLE_ANIMATION_DURATION = 100
private const val HANDLE_HIDE_DELAY = 1000
private const val SCROLLER_HIDE_DELAY = 3000
-private const val TRACK_SNAP_RANGE = 5
private const val HIDE_HANDLE = 0
private const val HIDE_SCROLLER = 1
private const val SHOW_SCROLLER = 2
-private const val SCALE_X = "scaleX"
-private const val SCALE_Y = "scaleY"
-private const val ALPHA = "alpha"
private const val ITEM_THRESHOLD = 25
class FastScroller : LinearLayout {
More information about the Android
mailing list