Highlighting sectioned apps on fast-scroll.
- This CL fixes an old assumption we had about the height
of rows in AllApps, and ensures that we account for the
difference in height between the predictive icons and the
normal icons.
- In addition, we refactor FastBitmapDrawable to have multiple
states, which it manages in drawing itself, including the
press state and fast scroll focus states. And we also refactor
some of the fast scroll logic in the all apps recycler view
out to its own class.
Change-Id: I1988159b2767df733bbbfc7dc601859cde6c9943
diff --git a/src/com/android/launcher3/BaseRecyclerViewFastScrollBar.java b/src/com/android/launcher3/BaseRecyclerViewFastScrollBar.java
index 32ea576..a680169 100644
--- a/src/com/android/launcher3/BaseRecyclerViewFastScrollBar.java
+++ b/src/com/android/launcher3/BaseRecyclerViewFastScrollBar.java
@@ -27,6 +27,7 @@
import android.graphics.Point;
import android.graphics.Rect;
import android.view.MotionEvent;
+import android.view.VelocityTracker;
import android.view.ViewConfiguration;
import com.android.launcher3.util.Thunk;
@@ -37,7 +38,7 @@
public class BaseRecyclerViewFastScrollBar {
public interface FastScrollFocusableView {
- void setFastScrollFocused(boolean focused, boolean animated);
+ void setFastScrollFocusState(final FastBitmapDrawable.State focusState, boolean animated);
}
private final static int MAX_TRACK_ALPHA = 30;
@@ -199,7 +200,7 @@
}
mTouchOffset += (lastY - downY);
mPopup.animateVisibility(true);
- animateScrollbar(true);
+ showActiveScrollbar(true);
}
if (mIsDragging) {
// Update the fastscroller section name at this touch position
@@ -210,7 +211,7 @@
(bottom - top));
mPopup.setSectionName(sectionName);
mPopup.animateVisibility(!sectionName.isEmpty());
- mRv.invalidate(mPopup.updateFastScrollerBounds(mRv, lastY));
+ mRv.invalidate(mPopup.updateFastScrollerBounds(lastY));
mLastTouchY = boundedY;
}
break;
@@ -222,7 +223,7 @@
if (mIsDragging) {
mIsDragging = false;
mPopup.animateVisibility(false);
- animateScrollbar(false);
+ showActiveScrollbar(false);
}
break;
}
@@ -246,7 +247,7 @@
/**
* Animates the width and color of the scrollbar.
*/
- private void animateScrollbar(boolean isScrolling) {
+ private void showActiveScrollbar(boolean isScrolling) {
if (mScrollbarAnimator != null) {
mScrollbarAnimator.cancel();
}