From 284aaa3fc20426f204c2d570bafa1954ab33eeee 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 | 54 +++++++++++++++++++++- .../launcher3/allapps/AllAppsRecyclerView.java | 10 +++- 4 files changed, 68 insertions(+), 2 deletions(-) (limited to 'src/com') diff --git a/src/com/android/launcher3/BaseRecyclerView.java b/src/com/android/launcher3/BaseRecyclerView.java index 77925b5b3..161b74e76 100644 --- a/src/com/android/launcher3/BaseRecyclerView.java +++ b/src/com/android/launcher3/BaseRecyclerView.java @@ -313,6 +313,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 4299b4457..1e36cda4f 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 a736f7770..61a89628d 100644 --- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java +++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java @@ -73,6 +73,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; + return offset; } @Override @@ -597,6 +644,11 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter