From 4e6798e38e9efa2673738ca42f26d687e3b76ab9 Mon Sep 17 00:00:00 2001 From: Alan Evans Date: Mon, 12 Aug 2019 15:05:49 -0400 Subject: [PATCH] Fix occasional double scroll bar on fast scroller. --- .../contact_selection_list_fragment.xml | 3 +- .../ContactSelectionListFragment.java | 3 + .../components/RecyclerViewFastScroller.java | 98 +++++++++---------- 3 files changed, 50 insertions(+), 54 deletions(-) diff --git a/res/layout/contact_selection_list_fragment.xml b/res/layout/contact_selection_list_fragment.xml index 9a4930e00d..27171aebc7 100644 --- a/res/layout/contact_selection_list_fragment.xml +++ b/res/layout/contact_selection_list_fragment.xml @@ -32,7 +32,8 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:visibility="gone" - android:layout_gravity="end"/> + android:layout_gravity="end" + tools:visibility="visible" /> = 11) { - if (currentAnimator != null) currentAnimator.cancel(); - currentAnimator = ObjectAnimator.ofFloat(bubble, "alpha", 0f, 1f).setDuration(BUBBLE_ANIMATION_DURATION); - currentAnimator.start(); - } + if (currentAnimator != null) currentAnimator.cancel(); + currentAnimator = ObjectAnimator.ofFloat(bubble, "alpha", 0f, 1f).setDuration(BUBBLE_ANIMATION_DURATION); + currentAnimator.start(); } - @TargetApi(11) private void hideBubble() { - if (VERSION.SDK_INT >= 11) { - if (currentAnimator != null) currentAnimator.cancel(); - currentAnimator = ObjectAnimator.ofFloat(bubble, "alpha", 1f, 0f).setDuration(BUBBLE_ANIMATION_DURATION); - currentAnimator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { - super.onAnimationEnd(animation); - bubble.setVisibility(INVISIBLE); - currentAnimator = null; - } + if (currentAnimator != null) currentAnimator.cancel(); + currentAnimator = ObjectAnimator.ofFloat(bubble, "alpha", 1f, 0f).setDuration(BUBBLE_ANIMATION_DURATION); + currentAnimator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + bubble.setVisibility(INVISIBLE); + currentAnimator = null; + } - @Override - public void onAnimationCancel(Animator animation) { - super.onAnimationCancel(animation); - bubble.setVisibility(INVISIBLE); - currentAnimator = null; - } - }); - currentAnimator.start(); - } else { - bubble.setVisibility(INVISIBLE); - } + @Override + public void onAnimationCancel(Animator animation) { + super.onAnimationCancel(animation); + bubble.setVisibility(INVISIBLE); + currentAnimator = null; + } + }); + currentAnimator.start(); } }