From 013e5a44e0c61522d384a0bf106e0a3f4b115fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCrten?= <sebastian@mobanisto.de> Date: Fri, 11 Feb 2022 22:22:06 +0100 Subject: [PATCH] Improve theming and status bar in particular * Fix status bar for API level 22 * Use ?android:colorBackground instead of white for light theme status bar * Create base theme for API-dependent modifications --- mailbox-android/src/main/res/values-v23/themes.xml | 8 ++++++++ mailbox-android/src/main/res/values/themes.xml | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 mailbox-android/src/main/res/values-v23/themes.xml diff --git a/mailbox-android/src/main/res/values-v23/themes.xml b/mailbox-android/src/main/res/values-v23/themes.xml new file mode 100644 index 00000000..18ae4cb0 --- /dev/null +++ b/mailbox-android/src/main/res/values-v23/themes.xml @@ -0,0 +1,8 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Theme.BriarMailbox" parent="Theme.BriarMailboxBase"> + <!-- API-dependent your theme here. --> + <item name="android:statusBarColor" tools:targetApi="21">?android:colorBackground</item> + <item name="android:windowLightStatusBar" tools:targetApi="23">true</item> + </style> +</resources> diff --git a/mailbox-android/src/main/res/values/themes.xml b/mailbox-android/src/main/res/values/themes.xml index 50018ee4..64bfe716 100644 --- a/mailbox-android/src/main/res/values/themes.xml +++ b/mailbox-android/src/main/res/values/themes.xml @@ -1,12 +1,13 @@ <resources xmlns:tools="http://schemas.android.com/tools"> <!-- Base application theme. --> - <style name="Theme.BriarMailbox" parent="Theme.Material3.DayNight.NoActionBar"> + <style name="Theme.BriarMailboxBase" parent="Theme.Material3.DayNight.NoActionBar"> <!-- Primary brand color. --> <item name="colorPrimary">@color/briar_night</item> <item name="colorPrimaryDark">@color/briar_blue</item> <item name="colorSecondary">@color/briar_green</item> <!-- Customize your theme here. --> - <item name="android:statusBarColor" tools:targetApi="21">@color/white</item> - <item name="android:windowLightStatusBar" tools:targetApi="23">true</item> + <item name="android:statusBarColor" tools:targetApi="21">@color/black</item> </style> + + <style name="Theme.BriarMailbox" parent="Theme.BriarMailboxBase" /> </resources> -- GitLab