[automerger skipped] Import translations. DO NOT MERGE am: 2f654f3dd3 -s ours
am skip reason: subject contains skip directive
Change-Id: Id9b3d01ace1da88c84d9be55fde27a9e52a5260c
diff --git a/Android.mk b/Android.mk
index b75cd3d..81a2976 100644
--- a/Android.mk
+++ b/Android.mk
@@ -26,25 +26,27 @@
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_ANDROID_LIBRARIES := WallpaperPicker2CommonDepsLib
-
+LOCAL_STATIC_JAVA_LIBRARIES := styleprotosnano
LOCAL_PROGUARD_ENABLED := disabled
-
-ifneq (,$(wildcard frameworks/base))
- LOCAL_PRIVATE_PLATFORM_APIS := true
-else
- LOCAL_SDK_VERSION := system_current
-endif
+LOCAL_SDK_VERSION := system_current
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_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 2564487..c0b2e8d 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 0000000..f3db20e
--- /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 bc83f36..0000000
--- 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 055a126..3ab13a4 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 fe2f691..43b8bf1 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 e103b69..98fae71 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/dimens.xml b/res/values/dimens.xml
index a2cb88b..f7d435c 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 a37f250..f3b950b 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_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 f918d8e..6583433 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 @@
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 37c64ac..a13d420 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 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}.
@@ -53,8 +53,8 @@
@Override
public void logActionClicked(String collectionId, int actionLabelResId) {
- WallpaperStatsLog.write(CODE, StyleEnums.WALLPAPER_EXPLORE, 0, 0, 0, 0, 0, collectionId.hashCode(),
- 0, 0, 0);
+ WallpaperStatsLog.write(CODE, StyleEnums.WALLPAPER_EXPLORE, 0, 0, 0, 0, 0,
+ collectionId.hashCode(), 0, 0, 0);
}
@Override
@@ -65,7 +65,7 @@
@Override
public void logCategorySelected(String collectionId) {
- WallpaperStatsLog.write(CODE, StyleEnums.WALLPAPER_SELECT,
+ WallpaperStatsLog.write(CODE, StyleEnums.WALLPAPER_OPEN_CATEGORY,
0, 0, 0, 0, 0,
collectionId.hashCode(),
0, 0, 0);
@@ -73,10 +73,11 @@
@Override
public void logWallpaperSet(String collectionId, @Nullable String wallpaperId) {
- WallpaperStatsLog.write(CODE, StyleEnums.WALLPAPER_SELECT,
+ WallpaperStatsLog.write(CODE, StyleEnums.WALLPAPER_APPLIED,
0, 0, 0, 0, 0,
collectionId.hashCode(),
- 0, 0, 0);
+ wallpaperId != null ? wallpaperId.hashCode() : 0,
+ 0, 0);
}
@Nullable
diff --git a/src/com/android/customization/picker/theme/ThemeFragment.java b/src/com/android/customization/picker/theme/ThemeFragment.java
index e4682bb..641d3e1 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.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 @@
// 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 0543b24..c3af91c 100644
--- a/src/com/android/customization/picker/theme/ThemePreviewPage.java
+++ b/src/com/android/customization/picker/theme/ThemePreviewPage.java
@@ -220,6 +220,8 @@
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 1ffca80..a2bcd4d 100755
--- a/src_override/com/android/wallpaper/module/WallpapersInjector.java
+++ b/src_override/com/android/wallpaper/module/WallpapersInjector.java
@@ -17,12 +17,12 @@
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 @@
WallpaperInfo wallpaperInfo,
int mode,
boolean testingModeEnabled) {
- return PreviewFragment.newInstance(wallpaperInfo, mode, testingModeEnabled);
+ return ImagePreviewFragment.newInstance(wallpaperInfo, mode, testingModeEnabled);
}
@Override