From 0a244ba105d2f2b6b5427f5d4999b9db3c468e10 Mon Sep 17 00:00:00 2001 From: cretin45 Date: Tue, 8 Mar 2016 12:18:15 -0800 Subject: Trebuchet: Highlight section being touched even when not scrolling scrubber Issue-id: CYNGNOS-1882 Change-Id: Ief8b6593528c1a04a95ffaeea44c379659427fd8 --- src/com/android/launcher3/BaseRecyclerView.java | 2 ++ .../launcher3/BaseRecyclerViewScrubber.java | 4 +++ .../launcher3/allapps/AllAppsGridAdapter.java | 30 +++++++++++++++++++--- .../launcher3/allapps/AllAppsRecyclerView.java | 6 +++++ 4 files changed, 39 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher3/BaseRecyclerView.java b/src/com/android/launcher3/BaseRecyclerView.java index cdf9aa2aa..d89c92270 100644 --- a/src/com/android/launcher3/BaseRecyclerView.java +++ b/src/com/android/launcher3/BaseRecyclerView.java @@ -321,6 +321,8 @@ public abstract class BaseRecyclerView extends RecyclerView public void setFastScrollDragging(boolean dragging) {} + public void setPreviousSectionFastScrollFocused() {} + /** * Updates the bounds for the scrollbar. *

Override in each subclass of this base class. diff --git a/src/com/android/launcher3/BaseRecyclerViewScrubber.java b/src/com/android/launcher3/BaseRecyclerViewScrubber.java index e3e08aa7c..7795de207 100644 --- a/src/com/android/launcher3/BaseRecyclerViewScrubber.java +++ b/src/com/android/launcher3/BaseRecyclerViewScrubber.java @@ -338,6 +338,10 @@ public class BaseRecyclerViewScrubber extends LinearLayout { } mBaseRecyclerView.setFastScrollDragging(mTouchingTrack); + if (mTouchingTrack) { + mBaseRecyclerView.setPreviousSectionFastScrollFocused(); + } + } } diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java index 3065fb428..643182588 100644 --- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java +++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java @@ -80,6 +80,9 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter= mFocusedSection.firstAppItem.position && + position < mFocusedSection.firstAppItem.position + + mFocusedSection.numApps) { + return false; + } + } + return mIconsDimmed; + } + public int getCustomPredictedAppsOffset(int rowIndex) { int offset = mCustomPredictedAppsHeaderHeight; if (rowIndex > 0) offset += mCustomPredictedAppsFooterHeight; @@ -661,6 +680,11 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter