android/source/AndroidManifest.xml                 |    2 +-
 android/source/res/layout/toolbar_bottom.xml       |    6 +++---
 android/source/res/layout/toolbar_color_picker.xml |    2 +-
 android/source/res/values/colors.xml               |    1 -
 android/source/res/values/themes.xml               |    5 ++---
 5 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 84996f452f86cb6e83ae0d86c1612e3f3c616a17
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Nov 28 12:20:55 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Nov 30 12:16:17 2023 +0100

    tdf#124480 android: Use theme bg color for bottom toolbars
    
    Instead of hard-coding the background color
    for the 2 toolbars shown at the bottom
    (`toolbar_bottom` and the color picker), use
    "colorPrimary" from the theme.
    
    Stop overriding "colorPrimary" in
    `LibreOfficeTheme.Toolbar`, which would otherwise
    result in a hard-coded white color being used again.
    
    This makes those toolbars show up in a darker color
    when dark theme is enabled.
    
    Stop hard-coding the font color of the items in
    the "Style" tab in the bottom toolbar to black, but
    use the primary font color instead, so a light color
    is automatically used when using the dark theme.
    
    Change-Id: Ib09ca47e8695903cdfa9f4eb100dc88ecae652a3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160069
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/android/source/res/layout/toolbar_bottom.xml 
b/android/source/res/layout/toolbar_bottom.xml
index 3fcd3bfc0fd0..ca9e0cf6e454 100644
--- a/android/source/res/layout/toolbar_bottom.xml
+++ b/android/source/res/layout/toolbar_bottom.xml
@@ -7,7 +7,7 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_alignParentBottom="true"
-    android:background="@color/toolbar_background"
+    android:background="?attr/colorPrimary"
     android:elevation="3dp"
     android:orientation="vertical"
     app:popupTheme="@style/LibreOfficeTheme.Toolbar"
@@ -391,7 +391,7 @@
                                         android:paddingTop="12dp"
                                         android:textSize="14sp"
                                         android:gravity="center_vertical"
-                                        android:textColor="@color/fontBlack"
+                                        
android:textColor="?android:attr/textColorPrimary"
                                         android:layout_alignParentLeft="true"
 
                                         />
@@ -420,7 +420,7 @@
                                         android:paddingTop="12dp"
                                         android:textSize="14sp"
                                         android:gravity="center_vertical"
-                                        android:textColor="@color/fontBlack"
+                                        
android:textColor="?android:attr/textColorPrimary"
                                         android:layout_alignParentLeft="true"
 
                                         />
diff --git a/android/source/res/layout/toolbar_color_picker.xml 
b/android/source/res/layout/toolbar_color_picker.xml
index 6a8f81b2a842..351542b1d2d0 100644
--- a/android/source/res/layout/toolbar_color_picker.xml
+++ b/android/source/res/layout/toolbar_color_picker.xml
@@ -6,7 +6,7 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_alignParentBottom="true"
-    android:background="@color/toolbar_background"
+    android:background="?attr/colorPrimary"
     android:elevation="3dp"
     android:orientation="vertical"
     app:popupTheme="@style/LibreOfficeTheme.Toolbar"
diff --git a/android/source/res/values/colors.xml 
b/android/source/res/values/colors.xml
index 3defb9a3ea83..791c0f23da23 100644
--- a/android/source/res/values/colors.xml
+++ b/android/source/res/values/colors.xml
@@ -93,7 +93,6 @@
     <color name="panel_grid_item_image_background">#D1D9E1</color>
 
     <color name="toolbar_foreground">#3e3e3e</color>
-    <color name="toolbar_background">#ffffff</color>
 
     <color name="handle_color">#26a69a</color>
 
diff --git a/android/source/res/values/themes.xml 
b/android/source/res/values/themes.xml
index 08b544797dea..bf815b5c659f 100644
--- a/android/source/res/values/themes.xml
+++ b/android/source/res/values/themes.xml
@@ -12,7 +12,6 @@
     </style>
 
     <style name="LibreOfficeTheme.Toolbar" 
parent="Theme.AppCompat.DayNight.NoActionBar">
-        <item name="colorPrimary">@color/toolbar_background</item>
     </style>
 
     <style name="LibreOfficeTheme.NavigationView">
commit d82a9cb8d6a1e11663f19a85cfb98ce9a94692be
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Nov 28 11:52:37 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Nov 30 12:16:10 2023 +0100

    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.wegh...@posteo.de>

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>
 

Reply via email to