From feae056067db286208b6f053921f95f5f0ebde09 Mon Sep 17 00:00:00 2001 From: Mill Chen Date: Thu, 15 Apr 2021 22:11:13 +0800 Subject: [PATCH] Tweak the layout of top app bar - Update the color of content scrim - Dynamically change the height of collapsing toolbar according to the line count of title - Fix the jank problem of collapsing toolbar Fixes: 184615642 Fixes: 185003521 Fixes: 182770567 Fixes: 184209747 Test: visual verified Change-Id: I78c517eb9bec0b85997085970007481d1a4ef7d3 --- res/layout/settings_collapsing_base_layout.xml | 15 +++++++++------ res/values-night/colors.xml | 2 ++ res/values/colors.xml | 3 +++ res/values/dimens.xml | 8 ++++++++ res/values/styles.xml | 4 ++-- .../settings/core/SettingsBaseActivity.java | 13 +++++++++---- 6 files changed, 33 insertions(+), 12 deletions(-) diff --git a/res/layout/settings_collapsing_base_layout.xml b/res/layout/settings_collapsing_base_layout.xml index ca9c132af5f..97d249c00ac 100644 --- a/res/layout/settings_collapsing_base_layout.xml +++ b/res/layout/settings_collapsing_base_layout.xml @@ -29,22 +29,25 @@ android:fitsSystemWindows="true" android:outlineAmbientShadowColor="@android:color/transparent" android:outlineSpotShadowColor="@android:color/transparent" - android:background="?android:attr/colorPrimary" + android:background="@android:color/transparent" android:theme="@style/Theme.CollapsingToolbar.Settings"> @color/palette_list_dark_mode_color_purple @color/palette_list_dark_mode_color_gray @android:color/black + + @*android:color/surface_header_dark diff --git a/res/values/colors.xml b/res/values/colors.xml index e107b65ce42..736a7dbc217 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -192,4 +192,7 @@ #5f6368 + + + @*android:color/surface_header_light \ No newline at end of file diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 304feb82021..6047092f8d3 100755 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -446,4 +446,12 @@ 2dp 1dp 2dp + + + 226dp + 270dp + 314dp + 174dp + 24dp + 24dp diff --git a/res/values/styles.xml b/res/values/styles.xml index 735cc15ab2e..31f44dd609a 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -781,7 +781,7 @@ @*android:string/config_headlineFontFamily -