Include a developer option sliding flag to toggle the different amount of apps to show

Bug: 299294792
Test: Verified SearchTransitionController didn't regress by turning off BACKGROUND_DRAWABLES flag.
Flag: ACONFIG com.android.launcher3.Flags.enable_private_space DEVELOPMENT
Change-Id: I78ee3a9dbc2d60f1b7acaa5834a8c656217a07d8
This commit is contained in:
Brandon Dayauon
2023-11-17 15:14:49 -08:00
parent 763e40d747
commit 96901c4541
2 changed files with 18 additions and 0 deletions
@@ -28,6 +28,7 @@ import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_HAPTIC_H
import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_HAPTIC_HINT_START_SCALE_PERCENT;
import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_SLOP_PERCENTAGE;
import static com.android.launcher3.LauncherPrefs.LONG_PRESS_NAV_HANDLE_TIMEOUT_MS;
import static com.android.launcher3.LauncherPrefs.PRIVATE_SPACE_APPS;
import static com.android.launcher3.settings.SettingsActivity.EXTRA_FRAGMENT_HIGHLIGHT_KEY;
import static com.android.launcher3.uioverrides.plugins.PluginManagerWrapper.PLUGIN_CHANGED;
import static com.android.launcher3.uioverrides.plugins.PluginManagerWrapper.pluginEnabledKey;
@@ -67,6 +68,7 @@ import androidx.preference.SeekBarPreference;
import androidx.preference.SwitchPreference;
import com.android.launcher3.ConstantItem;
import com.android.launcher3.Flags;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.R;
import com.android.launcher3.config.FeatureFlags;
@@ -115,6 +117,9 @@ public class DeveloperOptionsUI {
addAllAppsFromOverviewCatergory();
}
addCustomLpnhCategory();
if (Flags.enablePrivateSpace()) {
addCustomPrivateAppsCategory();
}
}
private void filterPreferences(String query, PreferenceGroup pg) {
@@ -365,6 +370,12 @@ public class DeveloperOptionsUI {
}
}
private void addCustomPrivateAppsCategory() {
PreferenceCategory category = newCategory("Apps in Private Space Config");
category.addPreference(createSeekBarPreference(
"Number of Apps to put in private region", 0, 100, 1, PRIVATE_SPACE_APPS));
}
/**
* Create a preference with text and a seek bar. Should be added to a PreferenceCategory.
*
@@ -364,6 +364,13 @@ class LauncherPrefs(private val encryptedContext: Context) {
EncryptionType.MOVE_TO_DEVICE_PROTECTED
)
@JvmField
val PRIVATE_SPACE_APPS =
nonRestorableItem(
"pref_private_space_apps",
0,
EncryptionType.MOVE_TO_DEVICE_PROTECTED
)
@JvmField
val THEMED_ICONS =
backedUpItem(Themes.KEY_THEMED_ICONS, false, EncryptionType.MOVE_TO_DEVICE_PROTECTED)
@JvmField val PROMISE_ICON_IDS = backedUpItem(InstallSessionHelper.PROMISE_ICON_IDS, "")