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/BaseContainerView.java | |
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/BaseContainerView.java')
-rw-r--r-- | src/com/android/launcher3/BaseContainerView.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/com/android/launcher3/BaseContainerView.java b/src/com/android/launcher3/BaseContainerView.java index e4ca29c88..dfc2d7b9c 100644 --- a/src/com/android/launcher3/BaseContainerView.java +++ b/src/com/android/launcher3/BaseContainerView.java @@ -49,6 +49,7 @@ public abstract class BaseContainerView extends LinearLayout implements Insettab // The inset to apply to the edges and between the search bar and the container private int mContainerBoundsInset; private boolean mHasSearchBar; + private boolean mUseScroller; private boolean mUseScrubber; protected View mScrubberContainerView; @@ -65,7 +66,8 @@ public abstract class BaseContainerView extends LinearLayout implements Insettab public BaseContainerView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); - mContainerBoundsInset = getResources().getDimensionPixelSize(R.dimen.container_bounds_inset); + mContainerBoundsInset = getResources().getDimensionPixelSize( + R.dimen.container_bounds_inset); mScrubberHeight = getResources().getDimensionPixelSize(R.dimen.scrubber_height); } @@ -105,11 +107,14 @@ public abstract class BaseContainerView extends LinearLayout implements Insettab public final void setScroller() { Context context = getContext(); - boolean useHorizontalScroller= SettingsProvider.getBoolean(context, + mUseScroller = SettingsProvider.getBoolean(context, + SettingsProvider.SETTINGS_UI_USE_SCROLLER, + R.bool.preferences_interface_use_scroller_default); + mUseScrubber = SettingsProvider.getBoolean(context, SettingsProvider.SETTINGS_UI_USE_HORIZONTAL_SCRUBBER, R.bool.preferences_interface_use_horizontal_scrubber_default); - mUseScrubber = useHorizontalScroller; - if (mUseScrubber) { + + if (mUseScroller && mUseScrubber) { ViewStub stub = (ViewStub) findViewById(R.id.scrubber_container_stub); mScrubberContainerView = stub.inflate(); if (mScrubberContainerView == null) { @@ -130,11 +135,15 @@ public abstract class BaseContainerView extends LinearLayout implements Insettab removeView(mScrubberContainerView); BaseRecyclerView recyclerView = getRecyclerView(); if (recyclerView != null) { - recyclerView.setUseScrollbar(true); + recyclerView.setUseScrollbar(mUseScroller); } } } + public final boolean useScroller() { + return mUseScroller; + } + public final boolean useScrubber() { return mUseScrubber; } |