Add a flag to turn on theme picker in wallpaper picker

Bug: 122524192
Change-Id: I79bd8bde359a56185c1dd0c10964695263d0f6d5
This commit is contained in:
Hyunyoung Song
2019-02-07 10:33:55 -08:00
parent fa8df691d1
commit 29e5d44a63
5 changed files with 15 additions and 1 deletions

View File

@@ -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;
@@ -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,
@@ -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);