summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchihhangchuang <chihhangchuang@google.com>2020-05-28 13:24:02 +0800
committerchihhangchuang <chihhangchuang@google.com>2020-05-28 13:24:02 +0800
commitdc2e2bf5213dbe1c334ba04a769e696438045080 (patch)
treec0ba615f41934a1656d7492d134f479f9b9fdb1f
parent6cbdde99b71724096b0cfaa52897a7219213dbb7 (diff)
downloadThemePicker-dc2e2bf5213dbe1c334ba04a769e696438045080.tar.gz
Add shadow for theme preview workspace texts
Also make the app name text smaller to match the icon scale. Screenshot: Launcher https://screenshot.googleplex.com/EDCmpVYQ7b8.png Full preview https://screenshot.googleplex.com/7JtXHwoqSrQ.png Compared with bug: Before https://screenshot.googleplex.com/0ifPX9NycWH.png After https://screenshot.googleplex.com/3cb2fKBoSYC.png Test: Manually Fixes: 157617856 Change-Id: Ia4d21adfc16a28a49be762f15aae23aa83606613
-rw-r--r--res/layout/theme_preview_app_icon_shape.xml4
-rw-r--r--res/values-night/colors.xml2
-rw-r--r--res/values/colors.xml1
-rw-r--r--res/values/dimens.xml4
-rw-r--r--src/com/android/customization/picker/theme/ThemeOptionPreviewer.java12
5 files changed, 22 insertions, 1 deletions
diff --git a/res/layout/theme_preview_app_icon_shape.xml b/res/layout/theme_preview_app_icon_shape.xml
index af541f93..fe95f904 100644
--- a/res/layout/theme_preview_app_icon_shape.xml
+++ b/res/layout/theme_preview_app_icon_shape.xml
@@ -37,6 +37,7 @@
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
+ android:clipChildren="false"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/app_item_1"
app:layout_constraintTop_toTopOf="parent"
@@ -62,6 +63,7 @@
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
+ android:clipChildren="false"
app:layout_constraintStart_toEndOf="@id/app_item_0"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
@@ -98,6 +100,7 @@
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
+ android:clipChildren="false"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/app_item_3"
app:layout_constraintTop_toTopOf="parent"
@@ -123,6 +126,7 @@
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
+ android:clipChildren="false"
app:layout_constraintStart_toEndOf="@id/app_item_2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml
index c6b2a3f0..feaf26fb 100644
--- a/res/values-night/colors.xml
+++ b/res/values-night/colors.xml
@@ -24,6 +24,8 @@
<color name="switch_track_tint">#171717</color>
<color name="switch_thumb_tint">#bdbdbd</color>
+ <color name="theme_preview_workspace_shadow_color">@android:color/transparent</color>
+
<color name="tile_enabled_icon_color">#2d2d2d</color>
<color name="tile_disabled_icon_color">@color/light_grey</color>
<color name="tile_disabled_background_color">#353535</color>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 437e4ea7..d4ad0e11 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -31,6 +31,7 @@
<color name="clockface_preview_background">@android:color/black</color>
<color name="theme_preview_icon_color">@color/google_grey700</color>
+ <color name="theme_preview_workspace_shadow_color">#B0000000</color>
<color name="text_color_dark">#2d2d2d</color>
<color name="text_color_light">@color/material_white_text</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 98ca16a7..461b39e0 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -79,13 +79,15 @@
<dimen name="preview_theme_smart_space_date_size">16sp</dimen>
<dimen name="preview_theme_app_icon_size">64dp</dimen>
<dimen name="preview_theme_app_icon_shape_text_margin_top">8dp</dimen>
- <dimen name="preview_theme_app_icon_shape_text_size">16sp</dimen>
+ <dimen name="preview_theme_app_icon_shape_text_size">14sp</dimen>
<dimen name="preview_theme_color_icons_padding_top">12dp</dimen>
<dimen name="preview_theme_color_icons_padding_bottom">20dp</dimen>
<dimen name="preview_theme_color_icons_padding_horizontal">18dp</dimen>
<dimen name="preview_theme_color_icons_title_text_size">12sp</dimen>
<dimen name="preview_theme_color_icons_icon_size">@dimen/preview_theme_icon_size</dimen>
<dimen name="preview_theme_color_icons_tile_size">@dimen/preview_theme_tile_size</dimen>
+ <dimen name="preview_theme_smartspace_key_ambient_shadow_blur">1.5dp</dimen>
+ <dimen name="preview_theme_app_name_key_ambient_shadow_blur">2.5dp</dimen>
<!-- For the customization previews on the picker. -->
<dimen name="preview_content_padding_top">@dimen/preview_page_top_margin</dimen>
diff --git a/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java b/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java
index a3850c6f..bdb20a75 100644
--- a/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java
+++ b/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java
@@ -205,11 +205,23 @@ class ThemeOptionPreviewer implements LifecycleObserver {
private void setHeadlineFont(Typeface headlineFont) {
mStatusBarClock.setTypeface(headlineFont);
mSmartSpaceDate.setTypeface(headlineFont);
+ mSmartSpaceDate.setShadowLayer(
+ mContext.getResources().getDimension(
+ R.dimen.preview_theme_smartspace_key_ambient_shadow_blur),
+ /* dx = */ 0,
+ /* dy = */ 0,
+ mContext.getColor(R.color.theme_preview_workspace_shadow_color));
// Update font of app names.
for (int id : mShapeIconAppNameIds) {
TextView appName = mContentView.findViewById(id);
appName.setTypeface(headlineFont);
+ appName.setShadowLayer(
+ mContext.getResources().getDimension(
+ R.dimen.preview_theme_app_name_key_ambient_shadow_blur),
+ /* dx = */ 0,
+ /* dy = */ 0,
+ mContext.getColor(R.color.theme_preview_workspace_shadow_color));
}
// Update font of color/icons section title.