diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-08-24 17:57:26 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-08-24 17:57:26 -0700 |
commit | a8f352c5b348d3b6dc33582a752e31f2e8d2200c (patch) | |
tree | 678ff01ee0bb7cd1c517fab8897c8ed12a8202aa /app/src/main | |
parent | 6d30b8cfda0c8d848d20abc6cd9805ed763836ef (diff) | |
download | dsub-a8f352c5b348d3b6dc33582a752e31f2e8d2200c.tar.gz dsub-a8f352c5b348d3b6dc33582a752e31f2e8d2200c.tar.bz2 dsub-a8f352c5b348d3b6dc33582a752e31f2e8d2200c.zip |
Don't show fast scroller until after user scrolls for first time
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/view/FastScroller.java | 7 |
1 files changed, 6 insertions, 1 deletions
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; + } } } |