diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2019-11-20 00:22:01 -0800 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2019-11-20 08:50:20 +0000 |
commit | e5d5cabe58b5b6f53422439ed6286e099943558f (patch) | |
tree | b83aa99ba6ca57123ffe1fb8dbf9b5264cc03b4e | |
parent | b45c8c365ba23344409220d8ca5a20621659886a (diff) | |
parent | 57778a27a2383a0d8635483b2045f9e09616e6e7 (diff) | |
download | ThemePicker-android10-qpr3-release.tar.gz |
Merging from ub-launcher3-qt-future-dev @ build 6018744android-mainline-10.0.0_r9android-mainline-10.0.0_r10android-10.0.0_r41android-10.0.0_r40android-10.0.0_r39android-10.0.0_r38android-10.0.0_r37android10-qpr3-s1-releaseandroid10-qpr3-releaseandroid10-mainline-media-release
Test: manual, presubmit on the source branch
http://x20/teams/android-launcher/merge/ub-launcher3-qt-future-dev_6018744.html
Change-Id: I91b31e68109d0838ac836a13b6bfd5dca33649a1
Merged-In: Ic8bb5eccb6edc0cf639ac08c404c930981721760
-rw-r--r-- | Android.mk | 15 | ||||
-rwxr-xr-x | AndroidManifest.xml | 4 | ||||
-rw-r--r-- | PREUPLOAD.cfg | 2 | ||||
-rw-r--r-- | res/drawable/ic_delete_24px.xml | 30 | ||||
-rw-r--r-- | res/layout/preview_card_cover_content.xml | 1 | ||||
-rw-r--r-- | res/layout/theme_component_preview.xml | 1 | ||||
-rw-r--r-- | res/layout/theme_option.xml | 8 | ||||
-rw-r--r-- | res/values-en-rCA/strings.xml | 69 | ||||
-rw-r--r-- | res/values-en-rXC/strings.xml | 69 | ||||
-rw-r--r-- | res/values-fi/strings.xml | 2 | ||||
-rw-r--r-- | res/values/dimens.xml | 1 | ||||
-rw-r--r-- | src/com/android/customization/model/theme/custom/ColorOptionsProvider.java | 2 | ||||
-rw-r--r-- | src/com/android/customization/model/theme/custom/ThemeComponentOption.java | 3 | ||||
-rw-r--r-- | src/com/android/customization/module/StatsLogUserEventLogger.java | 10 | ||||
-rw-r--r-- | src/com/android/customization/picker/theme/ThemeFragment.java | 3 | ||||
-rw-r--r-- | src/com/android/customization/picker/theme/ThemePreviewPage.java | 2 | ||||
-rwxr-xr-x | src_override/com/android/wallpaper/module/WallpapersInjector.java | 8 |
17 files changed, 176 insertions, 54 deletions
@@ -26,25 +26,26 @@ LOCAL_USE_AAPT2 := true LOCAL_MODULE_TAGS := optional LOCAL_STATIC_ANDROID_LIBRARIES := WallpaperPicker2CommonDepsLib - +LOCAL_STATIC_JAVA_LIBRARIES := styleprotosnano LOCAL_PROGUARD_ENABLED := disabled +LOCAL_PACKAGE_NAME := ThemePicker +LOCAL_PRIVILEGED_MODULE := true +LOCAL_PRODUCT_MODULE := true +LOCAL_OVERRIDES_PACKAGES := WallpaperPicker2 + ifneq (,$(wildcard frameworks/base)) LOCAL_PRIVATE_PLATFORM_APIS := true else LOCAL_SDK_VERSION := system_current + LOCAL_STATIC_JAVA_LIBRARIES += libSharedWallpaper endif -LOCAL_PACKAGE_NAME := ThemePicker -LOCAL_PRIVILEGED_MODULE := true -LOCAL_PRODUCT_MODULE := true -LOCAL_OVERRIDES_PACKAGES := WallpaperPicker2 - LOCAL_SRC_FILES := $(call all-java-files-under, $(WALLPAPER_PATH)/src) \ $(call all-java-files-under, src) \ $(call all-java-files-under, src_override) -LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res LOCAL_MANIFEST_FILE := AndroidManifest.xml diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 2564487b..c0b2e8d2 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -23,7 +23,7 @@ <activity android:name="com.android.customization.picker.CustomizationPickerActivity" android:label="@string/app_name" - android:resizeableActivity="true" + android:resizeableActivity="false" android:theme="@style/CustomizationTheme.NoActionBar"> <intent-filter> <action android:name="android.intent.action.SET_WALLPAPER"/> @@ -32,7 +32,7 @@ </intent-filter> </activity> <activity android:name="com.android.customization.picker.theme.CustomThemeActivity" - android:resizeableActivity="true" + android:resizeableActivity="false" android:theme="@style/CustomizationTheme.NoActionBar"/> </application> diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg new file mode 100644 index 00000000..f3db20e3 --- /dev/null +++ b/PREUPLOAD.cfg @@ -0,0 +1,2 @@ +[Hook Scripts] +checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT} diff --git a/res/drawable/ic_delete_24px.xml b/res/drawable/ic_delete_24px.xml deleted file mode 100644 index bc83f368..00000000 --- a/res/drawable/ic_delete_24px.xml +++ /dev/null @@ -1,30 +0,0 @@ -<!-- - Copyright (C) 2019 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:viewportWidth="24" - android:viewportHeight="24"> - <path - android:fillColor="@android:color/white" - android:pathData="M15,4V3H9v1H4v2h1v13c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V6h1V4H15zM17,19H7V6h10V19z"/> - <path - android:fillColor="@android:color/white" - android:pathData="M9,8h2v9h-2z"/> - <path - android:fillColor="@android:color/white" - android:pathData="M13,8h2v9h-2z"/> -</vector> diff --git a/res/layout/preview_card_cover_content.xml b/res/layout/preview_card_cover_content.xml index 055a1261..3ab13a48 100644 --- a/res/layout/preview_card_cover_content.xml +++ b/res/layout/preview_card_cover_content.xml @@ -22,6 +22,7 @@ android:layout_gravity="center" android:layout_marginHorizontal="@dimen/preview_theme_cover_content_extra_margin" android:gravity="center_horizontal" + android:clipChildren="false" tools:showIn="@layout/theme_preview_card"> <FrameLayout android:layout_width="@dimen/preview_theme_icon_size" diff --git a/res/layout/theme_component_preview.xml b/res/layout/theme_component_preview.xml index fe2f6913..43b8bf14 100644 --- a/res/layout/theme_component_preview.xml +++ b/res/layout/theme_component_preview.xml @@ -63,6 +63,7 @@ android:layout_height="0dp" android:layout_marginHorizontal="8dp" android:layout_marginTop="@dimen/preview_theme_content_margin" + android:clipChildren="false" app:layout_constraintBottom_toTopOf="@+id/guideline" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHeight_max="@dimen/preview_theme_content_max_height" diff --git a/res/layout/theme_option.xml b/res/layout/theme_option.xml index e103b69e..98fae714 100644 --- a/res/layout/theme_option.xml +++ b/res/layout/theme_option.xml @@ -62,9 +62,13 @@ android:layout_height="@dimen/theme_option_font_sample_height" android:layout_alignParentBottom="true" android:layout_gravity="center_horizontal" + android:autoSizeMaxTextSize="@dimen/theme_option_font_text_size" + android:autoSizeMinTextSize="@dimen/theme_option_font_min_text_size" + android:autoSizeTextType="uniform" android:gravity="center" - android:textSize="@dimen/theme_option_font_text_size" android:letterSpacing=".2" - android:text="@string/theme_font_example"/> + android:text="@string/theme_font_example" + android:textAlignment="center" + android:textSize="@dimen/theme_option_font_text_size" /> </RelativeLayout> </LinearLayout> diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml new file mode 100644 index 00000000..756ad00d --- /dev/null +++ b/res/values-en-rCA/strings.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (C) 2018 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<resources xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="app_name" msgid="6995669566699638946">"Styles & wallpapers"</string> + <string name="theme_title" msgid="2144932106319405101">"Style"</string> + <string name="clock_title" msgid="2126046720254613991">"Clock"</string> + <string name="grid_title" msgid="2825094404523390773">"Grid"</string> + <string name="wallpaper_title" msgid="6952635398953194544">"Wallpaper"</string> + <string name="apply_theme_btn" msgid="6293081192321303991">"Apply"</string> + <string name="edit_custom_theme_lbl" msgid="5211377705710775224">"Tap to edit"</string> + <string name="keep_my_wallpaper" msgid="8012385376769568517">"Keep current wallpaper"</string> + <string name="apply_btn" msgid="7965877231041987336">"Apply"</string> + <string name="accessibility_preview_pager" msgid="3548503287402185430">"Page <xliff:g id="ID_1">%1$d</xliff:g> of <xliff:g id="ID_2">%2$d</xliff:g>"</string> + <string name="next_page_content_description" msgid="5290226604542300962">"Next"</string> + <string name="previous_page_content_description" msgid="6025726405430262788">"Previous"</string> + <string name="option_applied_description" msgid="5022305212078053534">"<xliff:g id="ID_1">%1$s</xliff:g>, currently applied"</string> + <string name="option_applied_previewed_description" msgid="5269654286638446858">"<xliff:g id="ID_1">%1$s</xliff:g>, currently applied and previewed"</string> + <string name="option_previewed_description" msgid="3467217598865047661">"<xliff:g id="ID_1">%1$s</xliff:g>, currently previewed"</string> + <string name="theme_description" msgid="3697012391785254635">"Font: <xliff:g id="ID_1">%1$s</xliff:g>, icons: <xliff:g id="ID_2">%2$s</xliff:g>, shape: <xliff:g id="ID_3">%3$s</xliff:g>, colour: <xliff:g id="ID_4">%4$s</xliff:g>"</string> + <string name="default_theme_title" msgid="2555741736622366797">"Default"</string> + <string name="preview_name_font" msgid="4465423899630037038">"Font"</string> + <string name="preview_name_icon" msgid="6818927315316316440">"Icon"</string> + <string name="preview_name_color" msgid="8776203144994416172">"Colour"</string> + <string name="preview_name_shape" msgid="5676971146080968721">"Shape"</string> + <string name="preview_name_wallpaper" msgid="1738652462949531828">"Wallpaper"</string> + <string name="font_card_title" msgid="2343292653502548685">"ABC • abc • 123"</string> + <string name="font_card_body" msgid="6790525594503904468">"Add your favourite fonts to every screen"</string> + <string name="grid_title_pattern" msgid="9188866567612607806">"<xliff:g id="ID_1">%1$d</xliff:g>x<xliff:g id="ID_2">%2$d</xliff:g>"</string> + <string name="applied_theme_msg" msgid="7348498271552054431">"Style applied"</string> + <string name="applied_clock_msg" msgid="1938218786265793285">"Clock applied"</string> + <string name="apply_theme_error_msg" msgid="791364062636538317">"There was a problem applying the style"</string> + <string name="custom_theme_next" msgid="6235420097213197301">"Next"</string> + <string name="custom_theme_previous" msgid="4941132112640503022">"Previous"</string> + <string name="custom_theme_title" msgid="2192300350332693631">"Custom <xliff:g id="ID_1">%1$d</xliff:g>"</string> + <string name="custom_theme_fragment_title" msgid="6615547284702040280">"Custom Style"</string> + <string name="custom_theme_delete" msgid="4744494663184126202">"Delete"</string> + <string name="font_component_title" msgid="8800340833695292049">"Choose font"</string> + <string name="icon_component_title" msgid="5779787138399083903">"Choose icons"</string> + <string name="color_component_title" msgid="1194089273921078816">"Choose colour"</string> + <string name="shape_component_title" msgid="8366847436022025538">"Choose shape"</string> + <string name="name_component_title" msgid="532425087968663437">"Name your style"</string> + <string name="icon_component_label" msgid="2625784884001407944">"Icons <xliff:g id="ID_1">%1$d</xliff:g>"</string> + <string name="delete_custom_theme_confirmation" msgid="4452137183628769394">"Delete Custom style?"</string> + <string name="delete_custom_theme_button" msgid="5102462988130208824">"Delete"</string> + <string name="cancel" msgid="4651030493668562067">"Cancel"</string> + <string name="set_theme_wallpaper_dialog_message" msgid="2179661027350908003">"Set style wallpaper"</string> + <string name="use_style_instead_title" msgid="1578754995763917502">"Use <xliff:g id="ID_1">%1$s</xliff:g> instead?"</string> + <string name="use_style_instead_body" msgid="3051937045807471496">"The components you chose match the <xliff:g id="ID_1">%1$s</xliff:g> style. Do you want to use <xliff:g id="ID_2">%1$s</xliff:g> instead?"</string> + <string name="use_style_button" msgid="1754493078383627019">"Use <xliff:g id="ID_1">%1$s</xliff:g>"</string> + <string name="no_thanks" msgid="7286616980115687627">"No thanks"</string> + <string name="clock_preview_content_description" msgid="5460561185905717460">"<xliff:g id="ID_1">%1$s</xliff:g> clock preview"</string> + <string name="something_went_wrong" msgid="529840112449799117">"Oops! Something went wrong."</string> +</resources> diff --git a/res/values-en-rXC/strings.xml b/res/values-en-rXC/strings.xml new file mode 100644 index 00000000..c92902f3 --- /dev/null +++ b/res/values-en-rXC/strings.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (C) 2018 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<resources xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="app_name" msgid="6995669566699638946">"Styles & wallpapers"</string> + <string name="theme_title" msgid="2144932106319405101">"Style"</string> + <string name="clock_title" msgid="2126046720254613991">"Clock"</string> + <string name="grid_title" msgid="2825094404523390773">"Grid"</string> + <string name="wallpaper_title" msgid="6952635398953194544">"Wallpaper"</string> + <string name="apply_theme_btn" msgid="6293081192321303991">"Apply"</string> + <string name="edit_custom_theme_lbl" msgid="5211377705710775224">"Tap to edit"</string> + <string name="keep_my_wallpaper" msgid="8012385376769568517">"Keep current wallpaper"</string> + <string name="apply_btn" msgid="7965877231041987336">"Apply"</string> + <string name="accessibility_preview_pager" msgid="3548503287402185430">"Page <xliff:g id="ID_1">%1$d</xliff:g> of <xliff:g id="ID_2">%2$d</xliff:g>"</string> + <string name="next_page_content_description" msgid="5290226604542300962">"Next"</string> + <string name="previous_page_content_description" msgid="6025726405430262788">"Previous"</string> + <string name="option_applied_description" msgid="5022305212078053534">"<xliff:g id="ID_1">%1$s</xliff:g>, currently applied"</string> + <string name="option_applied_previewed_description" msgid="5269654286638446858">"<xliff:g id="ID_1">%1$s</xliff:g>, currently applied and previewed"</string> + <string name="option_previewed_description" msgid="3467217598865047661">"<xliff:g id="ID_1">%1$s</xliff:g>, currently previewed"</string> + <string name="theme_description" msgid="3697012391785254635">"Font: <xliff:g id="ID_1">%1$s</xliff:g>, icons: <xliff:g id="ID_2">%2$s</xliff:g>, shape: <xliff:g id="ID_3">%3$s</xliff:g>, color: <xliff:g id="ID_4">%4$s</xliff:g>"</string> + <string name="default_theme_title" msgid="2555741736622366797">"Default"</string> + <string name="preview_name_font" msgid="4465423899630037038">"Font"</string> + <string name="preview_name_icon" msgid="6818927315316316440">"Icon"</string> + <string name="preview_name_color" msgid="8776203144994416172">"Color"</string> + <string name="preview_name_shape" msgid="5676971146080968721">"Shape"</string> + <string name="preview_name_wallpaper" msgid="1738652462949531828">"Wallpaper"</string> + <string name="font_card_title" msgid="2343292653502548685">"ABC • abc • 123"</string> + <string name="font_card_body" msgid="6790525594503904468">"Add your favorite fonts to every screen"</string> + <string name="grid_title_pattern" msgid="9188866567612607806">"<xliff:g id="ID_1">%1$d</xliff:g>x<xliff:g id="ID_2">%2$d</xliff:g>"</string> + <string name="applied_theme_msg" msgid="7348498271552054431">"Style applied"</string> + <string name="applied_clock_msg" msgid="1938218786265793285">"Clock applied"</string> + <string name="apply_theme_error_msg" msgid="791364062636538317">"There was a problem applying the style"</string> + <string name="custom_theme_next" msgid="6235420097213197301">"Next"</string> + <string name="custom_theme_previous" msgid="4941132112640503022">"Previous"</string> + <string name="custom_theme_title" msgid="2192300350332693631">"Custom <xliff:g id="ID_1">%1$d</xliff:g>"</string> + <string name="custom_theme_fragment_title" msgid="6615547284702040280">"Custom Style"</string> + <string name="custom_theme_delete" msgid="4744494663184126202">"Delete"</string> + <string name="font_component_title" msgid="8800340833695292049">"Choose font"</string> + <string name="icon_component_title" msgid="5779787138399083903">"Choose icons"</string> + <string name="color_component_title" msgid="1194089273921078816">"Choose color"</string> + <string name="shape_component_title" msgid="8366847436022025538">"Choose shape"</string> + <string name="name_component_title" msgid="532425087968663437">"Name your style"</string> + <string name="icon_component_label" msgid="2625784884001407944">"Icons <xliff:g id="ID_1">%1$d</xliff:g>"</string> + <string name="delete_custom_theme_confirmation" msgid="4452137183628769394">"Delete Custom style?"</string> + <string name="delete_custom_theme_button" msgid="5102462988130208824">"Delete"</string> + <string name="cancel" msgid="4651030493668562067">"Cancel"</string> + <string name="set_theme_wallpaper_dialog_message" msgid="2179661027350908003">"Set style wallpaper"</string> + <string name="use_style_instead_title" msgid="1578754995763917502">"Use <xliff:g id="ID_1">%1$s</xliff:g> instead?"</string> + <string name="use_style_instead_body" msgid="3051937045807471496">"The components you chose match the <xliff:g id="ID_1">%1$s</xliff:g> style. Do you want to use <xliff:g id="ID_2">%1$s</xliff:g> instead?"</string> + <string name="use_style_button" msgid="1754493078383627019">"Use <xliff:g id="ID_1">%1$s</xliff:g>"</string> + <string name="no_thanks" msgid="7286616980115687627">"No, thanks"</string> + <string name="clock_preview_content_description" msgid="5460561185905717460">"<xliff:g id="ID_1">%1$s</xliff:g> clock preview"</string> + <string name="something_went_wrong" msgid="529840112449799117">"Oops! Something went wrong."</string> +</resources> diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml index 696b5d32..afba860e 100644 --- a/res/values-fi/strings.xml +++ b/res/values-fi/strings.xml @@ -65,5 +65,5 @@ <string name="use_style_button" msgid="1754493078383627019">"Valitse <xliff:g id="ID_1">%1$s</xliff:g>"</string> <string name="no_thanks" msgid="7286616980115687627">"Ei kiitos"</string> <string name="clock_preview_content_description" msgid="5460561185905717460">"Kellon esikatselu: <xliff:g id="ID_1">%1$s</xliff:g>"</string> - <string name="something_went_wrong" msgid="529840112449799117">"Hups! Jokin meni vikaan."</string> + <string name="something_went_wrong" msgid="529840112449799117">"Hups! Jotain meni pieleen.."</string> </resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index a2cb88ba..f7d435c3 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -56,6 +56,7 @@ <dimen name="option_bottom_margin">8dp</dimen> <!-- Note, using dp instead of sp as this text is more like a "snapshot" of the font --> <dimen name="theme_option_font_text_size">16dp</dimen> + <dimen name="theme_option_font_min_text_size">15dp</dimen> <dimen name="theme_option_title_font_text_size">12sp</dimen> <dimen name="option_tile_margin_horizontal">6dp</dimen> diff --git a/src/com/android/customization/model/theme/custom/ColorOptionsProvider.java b/src/com/android/customization/model/theme/custom/ColorOptionsProvider.java index a37f250d..f3b950b5 100644 --- a/src/com/android/customization/model/theme/custom/ColorOptionsProvider.java +++ b/src/com/android/customization/model/theme/custom/ColorOptionsProvider.java @@ -24,8 +24,6 @@ import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_ANDROID; import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_SHAPE; import static com.android.customization.model.ResourceConstants.PATH_SIZE; -import static com.android.customization.model.ResourceConstants.SYSUI_PACKAGE; -import static com.android.customization.model.theme.custom.ThemeComponentOption.ColorOption.COLOR_TILES_ICON_IDS; import android.content.Context; import android.content.pm.PackageManager; diff --git a/src/com/android/customization/model/theme/custom/ThemeComponentOption.java b/src/com/android/customization/model/theme/custom/ThemeComponentOption.java index f918d8e0..65834334 100644 --- a/src/com/android/customization/model/theme/custom/ThemeComponentOption.java +++ b/src/com/android/customization/model/theme/custom/ThemeComponentOption.java @@ -379,10 +379,13 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC seekbar.setProgressBackgroundTintList(seekbarTintList); // Disable seekbar seekbar.setOnTouchListener((view, motionEvent) -> true); + + int iconFgColor = res.getColor(R.color.tile_enabled_icon_color, null); if (!mIcons.isEmpty() && mShapeDrawable != null) { for (int i = 0; i < COLOR_TILE_IDS.length; i++) { Drawable icon = mIcons.get(COLOR_TILES_ICON_IDS[i][1]).getConstantState() .newDrawable(); + icon.setTint(iconFgColor); //TODO: load and set the shape. Drawable bgShape = mShapeDrawable.getConstantState().newDrawable(); bgShape.setTint(accentColor); diff --git a/src/com/android/customization/module/StatsLogUserEventLogger.java b/src/com/android/customization/module/StatsLogUserEventLogger.java index e604f999..a13d4208 100644 --- a/src/com/android/customization/module/StatsLogUserEventLogger.java +++ b/src/com/android/customization/module/StatsLogUserEventLogger.java @@ -15,12 +15,14 @@ */ package com.android.customization.module; +import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_COLOR; +import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_FONT; +import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_SHAPE; + import android.stats.style.nano.StyleEnums; -import android.util.Log; import androidx.annotation.Nullable; -import com.android.systemui.shared.system.StatsLogCompat; import com.android.customization.model.clock.Clockface; import com.android.customization.model.grid.GridOption; import com.android.customization.model.theme.ThemeBundle; @@ -29,9 +31,7 @@ import com.android.wallpaper.module.NoOpUserEventLogger; import java.util.Map; import java.util.Objects; -import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_COLOR; -import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_FONT; -import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_SHAPE; + /** * StatsLog-backed implementation of {@link ThemesUserEventLogger}. diff --git a/src/com/android/customization/picker/theme/ThemeFragment.java b/src/com/android/customization/picker/theme/ThemeFragment.java index e4682bb7..641d3e1f 100644 --- a/src/com/android/customization/picker/theme/ThemeFragment.java +++ b/src/com/android/customization/picker/theme/ThemeFragment.java @@ -23,7 +23,6 @@ import android.content.res.ColorStateList; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; -import android.graphics.Matrix; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; @@ -455,10 +454,12 @@ public class ThemeFragment extends ToolbarFragment { // Disable seekbar seekbar.setOnTouchListener((view, motionEvent) -> true); + int iconFgColor = res.getColor(R.color.tile_enabled_icon_color, null); for (int i = 0; i < mColorTileIds.length && i < previewInfo.icons.size(); i++) { Drawable icon = previewInfo.icons.get(mColorTileIconIds[i][1]) .getConstantState().newDrawable().mutate(); + icon.setTint(iconFgColor); Drawable bgShape = previewInfo.shapeDrawable.getConstantState().newDrawable(); bgShape.setTint(accentColor); diff --git a/src/com/android/customization/picker/theme/ThemePreviewPage.java b/src/com/android/customization/picker/theme/ThemePreviewPage.java index 0543b245..c3af91cd 100644 --- a/src/com/android/customization/picker/theme/ThemePreviewPage.java +++ b/src/com/android/customization/picker/theme/ThemePreviewPage.java @@ -220,6 +220,8 @@ abstract class ThemePreviewPage extends PreviewPage { TextView editLabel = card.findViewById(R.id.edit_label); editLabel.setOnClickListener(mEditClickListener); card.setOnClickListener(mEditClickListener); + card.setClickable(mEditClickListener != null); + editLabel.setVisibility(mEditClickListener != null ? View.VISIBLE : View.INVISIBLE); diff --git a/src_override/com/android/wallpaper/module/WallpapersInjector.java b/src_override/com/android/wallpaper/module/WallpapersInjector.java index 1ffca80b..a2bcd4db 100755 --- a/src_override/com/android/wallpaper/module/WallpapersInjector.java +++ b/src_override/com/android/wallpaper/module/WallpapersInjector.java @@ -17,12 +17,12 @@ package com.android.wallpaper.module; import android.content.Context; +import androidx.fragment.app.Fragment; + import com.android.wallpaper.model.CategoryProvider; import com.android.wallpaper.model.WallpaperInfo; import com.android.wallpaper.monitor.PerformanceMonitor; -import com.android.wallpaper.picker.PreviewFragment; - -import androidx.fragment.app.Fragment; +import com.android.wallpaper.picker.ImagePreviewFragment; /** * A concrete, real implementation of the dependency provider. @@ -69,7 +69,7 @@ public class WallpapersInjector extends BaseWallpaperInjector { WallpaperInfo wallpaperInfo, int mode, boolean testingModeEnabled) { - return PreviewFragment.newInstance(wallpaperInfo, mode, testingModeEnabled); + return ImagePreviewFragment.newInstance(wallpaperInfo, mode, testingModeEnabled); } @Override |