Loading res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,8 @@ <string name="widget_button_text">Widgets</string> <!-- Text for wallpaper change button --> <string name="wallpaper_button_text">Wallpapers</string> <!-- Text for wallpaper change button --> <string name="styles_wallpaper_button_text">Styles & wallpapers</string> <!-- Text for settings button --> <string name="settings_button_text">Home settings</string> <!-- Message shown when a feature is disabled by the administrator --> Loading robolectric_tests/src/com/android/launcher3/config/FlagOverrideSampleTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ public class FlagOverrideSampleTest { public void withFlagOn() { assertTrue(FeatureFlags.EXAMPLE_FLAG.get()); assertFalse(FeatureFlags.QUICK_SWITCH.get()); assertFalse(FeatureFlags.STYLE_WALLPAPER.get()); } Loading src/com/android/launcher3/Utilities.java +1 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ public final class Utilities { // An intent extra to indicate the horizontal scroll of the wallpaper. public static final String EXTRA_WALLPAPER_OFFSET = "com.android.launcher3.WALLPAPER_OFFSET"; public static final String EXTRA_WALLPAPER_FLAVOR = "com.android.launcher3.WALLPAPER_FLAVOR"; // These values are same as that in {@link AsyncTask}. private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors(); Loading src/com/android/launcher3/config/BaseFlags.java +4 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,10 @@ abstract class BaseFlags { = new ToggleableGlobalSettingsFlag("QUICK_SWITCH", false, "Swiping right on the nav bar while in an app switches to the previous app"); public static final ToggleableGlobalSettingsFlag STYLE_WALLPAPER = new ToggleableGlobalSettingsFlag("STYLE_WALLPAPER", false, "Direct users to the new ThemePicker based WallpaperPicker"); /** * Feature flag to handle define config changes dynamically instead of killing the process. */ Loading src/com/android/launcher3/views/OptionsPopupView.java +7 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.launcher3.views; import static com.android.launcher3.Utilities.EXTRA_WALLPAPER_FLAVOR; import static com.android.launcher3.Utilities.EXTRA_WALLPAPER_OFFSET; import android.content.Context; Loading Loading @@ -149,7 +150,9 @@ public class OptionsPopupView extends ArrowPopup RectF target = new RectF(x - halfSize, y - halfSize, x + halfSize, y + halfSize); ArrayList<OptionItem> options = new ArrayList<>(); options.add(new OptionItem(R.string.wallpaper_button_text, R.drawable.ic_wallpaper, int res = FeatureFlags.STYLE_WALLPAPER.get() ? R.string.styles_wallpaper_button_text : R.string.wallpaper_button_text; options.add(new OptionItem(res, R.drawable.ic_wallpaper, ControlType.WALLPAPER_BUTTON, OptionsPopupView::startWallpaperPicker)); if (!FeatureFlags.GO_DISABLE_WIDGETS) { options.add(new OptionItem(R.string.widget_button_text, R.drawable.ic_widget, Loading Loading @@ -197,6 +200,9 @@ public class OptionsPopupView extends ArrowPopup .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) .putExtra(EXTRA_WALLPAPER_OFFSET, launcher.getWorkspace().getWallpaperOffsetForCenterPage()); if (!FeatureFlags.STYLE_WALLPAPER.get()) { intent.putExtra(EXTRA_WALLPAPER_FLAVOR, "wallpaper_only"); } String pickerPackage = launcher.getString(R.string.wallpaper_picker_package); if (!TextUtils.isEmpty(pickerPackage)) { intent.setPackage(pickerPackage); Loading Loading
res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,8 @@ <string name="widget_button_text">Widgets</string> <!-- Text for wallpaper change button --> <string name="wallpaper_button_text">Wallpapers</string> <!-- Text for wallpaper change button --> <string name="styles_wallpaper_button_text">Styles & wallpapers</string> <!-- Text for settings button --> <string name="settings_button_text">Home settings</string> <!-- Message shown when a feature is disabled by the administrator --> Loading
robolectric_tests/src/com/android/launcher3/config/FlagOverrideSampleTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ public class FlagOverrideSampleTest { public void withFlagOn() { assertTrue(FeatureFlags.EXAMPLE_FLAG.get()); assertFalse(FeatureFlags.QUICK_SWITCH.get()); assertFalse(FeatureFlags.STYLE_WALLPAPER.get()); } Loading
src/com/android/launcher3/Utilities.java +1 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ public final class Utilities { // An intent extra to indicate the horizontal scroll of the wallpaper. public static final String EXTRA_WALLPAPER_OFFSET = "com.android.launcher3.WALLPAPER_OFFSET"; public static final String EXTRA_WALLPAPER_FLAVOR = "com.android.launcher3.WALLPAPER_FLAVOR"; // These values are same as that in {@link AsyncTask}. private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors(); Loading
src/com/android/launcher3/config/BaseFlags.java +4 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,10 @@ abstract class BaseFlags { = new ToggleableGlobalSettingsFlag("QUICK_SWITCH", false, "Swiping right on the nav bar while in an app switches to the previous app"); public static final ToggleableGlobalSettingsFlag STYLE_WALLPAPER = new ToggleableGlobalSettingsFlag("STYLE_WALLPAPER", false, "Direct users to the new ThemePicker based WallpaperPicker"); /** * Feature flag to handle define config changes dynamically instead of killing the process. */ Loading
src/com/android/launcher3/views/OptionsPopupView.java +7 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.launcher3.views; import static com.android.launcher3.Utilities.EXTRA_WALLPAPER_FLAVOR; import static com.android.launcher3.Utilities.EXTRA_WALLPAPER_OFFSET; import android.content.Context; Loading Loading @@ -149,7 +150,9 @@ public class OptionsPopupView extends ArrowPopup RectF target = new RectF(x - halfSize, y - halfSize, x + halfSize, y + halfSize); ArrayList<OptionItem> options = new ArrayList<>(); options.add(new OptionItem(R.string.wallpaper_button_text, R.drawable.ic_wallpaper, int res = FeatureFlags.STYLE_WALLPAPER.get() ? R.string.styles_wallpaper_button_text : R.string.wallpaper_button_text; options.add(new OptionItem(res, R.drawable.ic_wallpaper, ControlType.WALLPAPER_BUTTON, OptionsPopupView::startWallpaperPicker)); if (!FeatureFlags.GO_DISABLE_WIDGETS) { options.add(new OptionItem(R.string.widget_button_text, R.drawable.ic_widget, Loading Loading @@ -197,6 +200,9 @@ public class OptionsPopupView extends ArrowPopup .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) .putExtra(EXTRA_WALLPAPER_OFFSET, launcher.getWorkspace().getWallpaperOffsetForCenterPage()); if (!FeatureFlags.STYLE_WALLPAPER.get()) { intent.putExtra(EXTRA_WALLPAPER_FLAVOR, "wallpaper_only"); } String pickerPackage = launcher.getString(R.string.wallpaper_picker_package); if (!TextUtils.isEmpty(pickerPackage)) { intent.setPackage(pickerPackage); Loading