diff --git a/lawnchair/res/values/config.xml b/lawnchair/res/values/config.xml index ed89783d06..d68ef4a8bf 100644 --- a/lawnchair/res/values/config.xml +++ b/lawnchair/res/values/config.xml @@ -91,6 +91,7 @@ false true false + true true false false diff --git a/lawnchair/res/values/strings.xml b/lawnchair/res/values/strings.xml index 1de0b316b6..47df2d1f98 100644 --- a/lawnchair/res/values/strings.xml +++ b/lawnchair/res/values/strings.xml @@ -343,6 +343,7 @@ Remember Position Remember the position when you left off instead of the top + Show Scrollbar Search Show Search Bar Automatically Show Keyboard diff --git a/lawnchair/src/app/lawnchair/preferences2/PreferenceManager2.kt b/lawnchair/src/app/lawnchair/preferences2/PreferenceManager2.kt index 88bd67edbb..81e6486367 100644 --- a/lawnchair/src/app/lawnchair/preferences2/PreferenceManager2.kt +++ b/lawnchair/src/app/lawnchair/preferences2/PreferenceManager2.kt @@ -202,6 +202,12 @@ class PreferenceManager2 private constructor(private val context: Context) : Pre onSet = { reloadHelper.reloadGrid() }, ) + val showScrollbar = preference( + key = booleanPreferencesKey(name = "all_apps_show_scrollbar"), + defaultValue = context.resources.getBoolean(R.bool.config_default_show_scrollbar), + onSet = { reloadHelper.recreate() }, + ) + val showTopShadow = preference( key = booleanPreferencesKey(name = "show_top_shadow"), defaultValue = context.resources.getBoolean(R.bool.config_default_show_top_shadow), diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/AppDrawerPreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/AppDrawerPreferences.kt index 409695c01c..f9c6c9add4 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/AppDrawerPreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/AppDrawerPreferences.kt @@ -76,6 +76,10 @@ fun AppDrawerPreferences() { description = stringResource(id = R.string.pref_all_apps_remember_position_description), adapter = prefs2.rememberPosition.getAdapter(), ) + SwitchPreference( + label = stringResource(id = R.string.pref_all_apps_show_scrollbar_title), + adapter = prefs2.showScrollbar.getAdapter(), + ) SuggestionsPreference() } diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index 6511a4fee7..44b389d1e7 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -261,6 +261,8 @@ public class ActivityAllAppsContainerView * onFinishInflate -> onPostCreate */ protected void initContent() { + boolean showFastScroller = PreferenceExtensionsKt.firstBlocking(pref2.getShowScrollbar()); + mMainAdapterProvider = mSearchUiDelegate.createMainAdapterProvider(); mAH.set(AdapterHolder.MAIN, new AdapterHolder(AdapterHolder.MAIN, @@ -277,7 +279,7 @@ public class ActivityAllAppsContainerView mSearchRecyclerView = findViewById(R.id.search_results_list_view); mFastScroller = findViewById(R.id.fast_scroller); mFastScroller.setPopupView(findViewById(R.id.fast_scroller_popup)); - + mFastScroller.setVisibility(showFastScroller ? VISIBLE : INVISIBLE); mSearchContainer = inflateSearchBar(); if (!isSearchBarFloating()) { // Add the search box above everything else in this container (if the flag is