aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github/daneren2005/dsub/view
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-08-24 17:48:00 -0700
committerScott Jackson <daneren2005@gmail.com>2015-08-24 17:48:00 -0700
commit6d30b8cfda0c8d848d20abc6cd9805ed763836ef (patch)
treef3f2dd1b7881f51cdb0d4598c097e8e138bc9eeb /app/src/main/java/github/daneren2005/dsub/view
parentc6d2629702b220e0ce9c19e41793dad84edcbb76 (diff)
downloaddsub-6d30b8cfda0c8d848d20abc6cd9805ed763836ef.tar.gz
dsub-6d30b8cfda0c8d848d20abc6cd9805ed763836ef.tar.bz2
dsub-6d30b8cfda0c8d848d20abc6cd9805ed763836ef.zip
Add fast scrolling with no bubble to NowPlayingFragment
Diffstat (limited to 'app/src/main/java/github/daneren2005/dsub/view')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/FastScroller.java20
1 files changed, 15 insertions, 5 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 1cc11c08..fdf2b815 100644
--- a/app/src/main/java/github/daneren2005/dsub/view/FastScroller.java
+++ b/app/src/main/java/github/daneren2005/dsub/view/FastScroller.java
@@ -45,6 +45,7 @@ public class FastScroller extends LinearLayout {
private RecyclerView recyclerView;
private final ScrollListener scrollListener = new ScrollListener();
private int height;
+ private boolean visibleBubble = true;
private ObjectAnimator currentAnimator = null;
@@ -90,8 +91,13 @@ public class FastScroller extends LinearLayout {
return false;
if(currentAnimator != null)
currentAnimator.cancel();
- if(bubble.getVisibility() == INVISIBLE)
- showBubble();
+ if(bubble.getVisibility() == INVISIBLE) {
+ if(visibleBubble) {
+ showBubble();
+ }
+ } else if(!visibleBubble) {
+ hideBubble();
+ }
handle.setSelected(true);
case MotionEvent.ACTION_MOVE:
final float y = event.getY();
@@ -139,9 +145,14 @@ public class FastScroller extends LinearLayout {
try {
String bubbleText = ((BubbleTextGetter) recyclerView.getAdapter()).getTextToShowInBubble(targetPos);
- bubble.setText(bubbleText);
+ if(bubbleText == null) {
+ visibleBubble = false;
+ bubble.setVisibility(View.INVISIBLE);
+ } else {
+ bubble.setText(bubbleText);
+ visibleBubble = true;
+ }
} catch(Exception e) {
- Log.e(TAG, "Item count: " + itemCount);
Log.e(TAG, "Error getting text for bubble", e);
}
}
@@ -160,7 +171,6 @@ public class FastScroller extends LinearLayout {
}
private void showBubble() {
- AnimatorSet animatorSet = new AnimatorSet();
bubble.setVisibility(VISIBLE);
if(currentAnimator != null)
currentAnimator.cancel();