From 61e71f0db0c5b059825e516f70110546f82c0bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timi=20Rautam=C3=A4ki?= Date: Wed, 13 Oct 2021 08:33:27 +0000 Subject: [PATCH] Updater: update layout and colors for 12 * Updated toolbar layout and behaviour * Changed colors to match AOSP settings Change-Id: Ic8efa69f9ba06055bac1772e1d9f3eb5ada67d8d --- Android.mk | 1 + res/layout/activity_updates.xml | 33 +++++++++----- res/values-night/colors.xml | 2 + res/values/colors.xml | 2 + res/values/styles.xml | 1 + .../lineageos/updater/ui/FlingBehavior.java | 45 ------------------- 6 files changed, 29 insertions(+), 55 deletions(-) delete mode 100644 src/org/lineageos/updater/ui/FlingBehavior.java diff --git a/Android.mk b/Android.mk index c5214e13..5afbfeee 100644 --- a/Android.mk +++ b/Android.mk @@ -16,6 +16,7 @@ LOCAL_STATIC_ANDROID_LIBRARIES := \ androidx.localbroadcastmanager_localbroadcastmanager \ androidx.preference_preference \ androidx.recyclerview_recyclerview \ + SettingsLib LOCAL_RESOURCE_DIR := \ $(LOCAL_PATH)/res diff --git a/res/layout/activity_updates.xml b/res/layout/activity_updates.xml index d9dba639..42fc30d7 100644 --- a/res/layout/activity_updates.xml +++ b/res/layout/activity_updates.xml @@ -12,18 +12,30 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" - app:layout_behavior="org.lineageos.updater.ui.FlingBehavior"> + android:outlineAmbientShadowColor="@android:color/transparent" + android:outlineSpotShadowColor="@android:color/transparent" + android:background="?android:attr/colorPrimary" + android:theme="@style/Theme.CollapsingToolbar.Settings"> + android:layout_height="wrap_content" + android:clipToPadding="false" + app:forceApplySystemWindowInsetTop="true" + app:extraMultilineHeightEnabled="true" + app:contentScrim="@color/toolbar_collapsed" + app:maxLines="3" + app:layout_scrollFlags="scroll|exitUntilCollapsed|snap" + app:scrimAnimationDuration="50" + app:scrimVisibleHeightTrigger="@dimen/settingslib_scrim_visible_height_trigger" + app:statusBarScrim="@null" + app:titleCollapseMode="fade" + app:collapsedTitleTextAppearance="@style/CollapsingToolbarTitle.Collapsed" + app:expandedTitleTextAppearance="@style/CollapsingToolbarTitle.Expanded" + app:expandedTitleMarginStart="@dimen/expanded_title_margin_start" + app:expandedTitleMarginEnd="@dimen/expanded_title_margin_end" + app:toolbarId="@id/action_bar"> + android:theme="?android:attr/actionBarTheme" + android:transitionName="shared_element_view" + app:layout_collapseMode="pin"/> diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml index 4470f73c..21b0fdcd 100644 --- a/res/values-night/colors.xml +++ b/res/values-night/colors.xml @@ -3,6 +3,8 @@ #212121 #1c1c1c @*android:color/accent_device_default_dark + @*android:color/system_neutral1_800 + @android:color/system_neutral1_700 #f5f5f5 diff --git a/res/values/colors.xml b/res/values/colors.xml index 608dd9bb..a7add882 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -3,6 +3,8 @@ #f5f5f5 #e0e0e0 @*android:color/accent_device_default_light + @*android:color/system_neutral1_0 + @android:color/system_neutral1_100 #FF0E0E0F #222222 diff --git a/res/values/styles.xml b/res/values/styles.xml index e87f58c0..c3efca45 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -7,6 +7,7 @@ true @bool/theme_is_light @bool/theme_is_light + @color/background