diff options
author | Martin Herndl <martin.herndl@gmail.com> | 2015-12-17 17:08:27 +0100 |
---|---|---|
committer | AdrianDC <radian.dc@gmail.com> | 2015-12-17 21:29:44 +0100 |
commit | dca57f366983a218732ab3251f066f1793f4cedc (patch) | |
tree | 036c964c7f058773de47867c47129e7790a6f989 /src/com/android/launcher3/allapps | |
parent | a343529cc30489de6c78870277311720630f524d (diff) | |
download | android_packages_apps_Trebuchet-dca57f366983a218732ab3251f066f1793f4cedc.tar.gz android_packages_apps_Trebuchet-dca57f366983a218732ab3251f066f1793f4cedc.tar.bz2 android_packages_apps_Trebuchet-dca57f366983a218732ab3251f066f1793f4cedc.zip |
Trebuchet: Add ability to disable the scroller completely
This change adds another toggle to the drawer settings which disables
the app drawer scroller completely. There is already a setting which
toggles between horizontal and vertical scroller, but I like my
drawer if it's even cleaner and uses no scroller at all.
Change-Id: Iad3efdafee264852f52e728341fd86d60452b05b
Diffstat (limited to 'src/com/android/launcher3/allapps')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsContainerView.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index feb96df29..5434e720f 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -89,7 +89,8 @@ final class SimpleSectionMergeAlgorithm implements AlphabeticalAppsList.MergeAlg private int mMaxAllowableMerges; private CharsetEncoder mAsciiEncoder; - public SimpleSectionMergeAlgorithm(int minAppsPerRow, int minRowsInMergedSection, int maxNumMerges) { + public SimpleSectionMergeAlgorithm(int minAppsPerRow, int minRowsInMergedSection, + int maxNumMerges) { mMinAppsPerRow = minAppsPerRow; mMinRowsInMergedSection = minRowsInMergedSection; mMaxAllowableMerges = maxNumMerges; @@ -252,7 +253,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc } private void updateScrubber() { - if (useScrubber()) { + if (useScroller() && useScrubber()) { mScrubber.updateSections(); } } @@ -458,21 +459,20 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc // names) int startInset = Math.max(mSectionNamesMargin, mAppsRecyclerView.getMaxScrollbarWidth()); int topBottomPadding = mRecyclerViewTopBottomPadding; - final boolean useScubber = useScrubber(); + final boolean useScrollerScrubber = useScroller() && useScrubber(); if (isRtl) { mAppsRecyclerView.setPadding(padding.left + mAppsRecyclerView.getMaxScrollbarWidth(), - topBottomPadding, padding.right + startInset, useScubber ? - mScrubberHeight + topBottomPadding : topBottomPadding); - if (useScubber) { - mScrubberContainerView - .setPadding(padding.left + mAppsRecyclerView.getMaxScrollbarWidth(), - 0, padding.right, 0); + topBottomPadding, padding.right + startInset, useScrollerScrubber ? + mScrubberHeight + topBottomPadding : topBottomPadding); + if (useScrollerScrubber) { + mScrubberContainerView.setPadding(padding.left + + mAppsRecyclerView.getMaxScrollbarWidth(), 0, padding.right, 0); } } else { mAppsRecyclerView.setPadding(padding.left + startInset, topBottomPadding, - padding.right + mAppsRecyclerView.getMaxScrollbarWidth(), - useScubber ? mScrubberHeight + topBottomPadding : topBottomPadding); - if (useScubber) { + padding.right + mAppsRecyclerView.getMaxScrollbarWidth(), useScrollerScrubber ? + mScrubberHeight + topBottomPadding : topBottomPadding); + if (useScrollerScrubber) { mScrubberContainerView.setPadding(padding.left, 0, padding.right + mAppsRecyclerView.getMaxScrollbarWidth(), 0); } @@ -488,7 +488,8 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc mSearchBarContainerView.getLayoutParams(); lp.leftMargin = searchBarBounds.left - backgroundPadding.left; lp.topMargin = searchBarBounds.top - backgroundPadding.top; - lp.rightMargin = (getMeasuredWidth() - searchBarBounds.right) - backgroundPadding.right; + lp.rightMargin = (getMeasuredWidth() - searchBarBounds.right) + - backgroundPadding.right; mSearchBarContainerView.requestLayout(); } } |