Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc2e2bf5 authored by chihhangchuang's avatar chihhangchuang
Browse files

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
parent 6cbdde99
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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"
+2 −0
Original line number Diff line number Diff line
@@ -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>
+1 −0
Original line number Diff line number Diff line
@@ -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>
+3 −1
Original line number Diff line number Diff line
@@ -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>
+12 −0
Original line number Diff line number Diff line
@@ -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.