summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-11-28 11:52:37 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2023-11-30 12:16:10 +0100
commitd82a9cb8d6a1e11663f19a85cfb98ce9a94692be (patch)
treeae83e8c74f23faffb39bc3c3df0a500cd8c9a246 /android
parent9e7df5bdf2c0e9585f01c16bbb5a377fe64299ca (diff)
tdf#124480 android: Support dark theme
Support dark theme by inheriting from the corresponding "AppCompat.DayNight" themes rather than forcing the use of a light theme by using the "AppCompat.Light" variants, s.a. [1]. With this in place, the app will automatically use a dark theme for the Android UI controls when that's enabled in the Android system settings. Toolbars and menus mostly look as expected. The bottom toolbar will be handled separately. Icons will also have to be adapted in a follow-up step to provide for better contrast, since they're currently designed for light mode/white background. [1] https://developer.android.com/develop/ui/views/theming/darktheme#themes-styles Change-Id: Ia08edcc9d22b93caa67b146dcf90ee5fd02ee550 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160068 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'android')
-rw-r--r--android/source/AndroidManifest.xml2
-rw-r--r--android/source/res/values/themes.xml4
2 files changed, 3 insertions, 3 deletions
diff --git a/android/source/AndroidManifest.xml b/android/source/AndroidManifest.xml
index 4a7c137878fb..9d1d309d7c9b 100644
--- a/android/source/AndroidManifest.xml
+++ b/android/source/AndroidManifest.xml
@@ -94,7 +94,7 @@
<activity
android:name=".SettingsActivity"
- android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
+ android:theme="@style/Theme.AppCompat.DayNight.DarkActionBar"
android:label="@string/app_name_settings">
</activity>
diff --git a/android/source/res/values/themes.xml b/android/source/res/values/themes.xml
index e26bee22eb31..08b544797dea 100644
--- a/android/source/res/values/themes.xml
+++ b/android/source/res/values/themes.xml
@@ -2,7 +2,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="LibreOfficeTheme" parent="LibreOfficeTheme.Base"/>
- <style name="LibreOfficeTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
+ <style name="LibreOfficeTheme.Base" parent="Theme.AppCompat.DayNight.NoActionBar">
</style>
<style name="ListItemText">
@@ -11,7 +11,7 @@
<item name="android:textSize">14sp</item>
</style>
- <style name="LibreOfficeTheme.Toolbar" parent="Theme.AppCompat.Light.NoActionBar">
+ <style name="LibreOfficeTheme.Toolbar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="colorPrimary">@color/toolbar_background</item>
</style>