From a8f352c5b348d3b6dc33582a752e31f2e8d2200c Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 24 Aug 2015 17:57:26 -0700 Subject: Don't show fast scroller until after user scrolls for first time --- app/src/main/java/github/daneren2005/dsub/view/FastScroller.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/src') diff --git a/app/src/main/java/github/daneren2005/dsub/view/FastScroller.java b/app/src/main/java/github/daneren2005/dsub/view/FastScroller.java index fdf2b815..c698e37b 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/FastScroller.java +++ b/app/src/main/java/github/daneren2005/dsub/view/FastScroller.java @@ -46,6 +46,7 @@ public class FastScroller extends LinearLayout { private final ScrollListener scrollListener = new ScrollListener(); private int height; private boolean visibleBubble = true; + private boolean hasScrolled = false; private ObjectAnimator currentAnimator = null; @@ -117,7 +118,6 @@ public class FastScroller extends LinearLayout { this.recyclerView = recyclerView; recyclerView.addOnScrollListener(scrollListener); recyclerView.setVerticalScrollBarEnabled(false); - setVisibility(View.VISIBLE); } public void detachRecyclerView() { recyclerView.removeOnScrollListener(scrollListener); @@ -217,6 +217,11 @@ public class FastScroller extends LinearLayout { position = (int)(((float)firstVisiblePosition/(((float)itemCount-(float)visibleRange)))*(float)itemCount); float proportion = (float)position/(float)itemCount; setBubbleAndHandlePosition(height*proportion); + + if(!hasScrolled && (dx > 0 || dy > 0)) { + setVisibility(View.VISIBLE); + hasScrolled = true; + } } } -- cgit v1.2.3