android/source/res/drawable/label_background.xml        |    4 ++--
 android/source/res/layout/activity_document_browser.xml |   15 +++++++--------
 android/source/res/layout/activity_main.xml             |    3 +--
 android/source/res/layout/item_recent_files.xml         |    1 -
 android/source/res/values/themes.xml                    |    2 +-
 5 files changed, 11 insertions(+), 14 deletions(-)

New commits:
commit 9e7df5bdf2c0e9585f01c16bbb5a377fe64299ca
Author:     Michael Weghorn <[email protected]>
AuthorDate: Tue Nov 28 10:23:06 2023 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Nov 30 12:16:02 2023 +0100

    tdf#124480 android: Replace hard-coded bg color with themeable one
    
    or drop explicitly setting background color where the
    one from the parent widget should be used.
    
    See also
    
https://developer.android.com/develop/ui/views/theming/darktheme#themes-styles
    
    Change-Id: I21dc4b7c45e2cc5add96d603abe5e781d4e09992
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160067
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/android/source/res/drawable/label_background.xml 
b/android/source/res/drawable/label_background.xml
index 1e097857537a..3e5b7b1cb907 100644
--- a/android/source/res/drawable/label_background.xml
+++ b/android/source/res/drawable/label_background.xml
@@ -2,8 +2,8 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android";>
     <item>
         <shape android:shape="rectangle">
-            <solid android:color="@color/background_normal" />
+            <solid android:color="?attr/colorBackgroundFloating" />
             <corners android:radius="5dp" />
         </shape>
     </item>
-</selector>
\ No newline at end of file
+</selector>
diff --git a/android/source/res/layout/activity_document_browser.xml 
b/android/source/res/layout/activity_document_browser.xml
index e47426871f72..b8c00cf973d0 100644
--- a/android/source/res/layout/activity_document_browser.xml
+++ b/android/source/res/layout/activity_document_browser.xml
@@ -119,7 +119,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:clickable="true"
-        app:backgroundTint="@color/background_normal"
+        app:backgroundTint="?attr/colorBackgroundFloating"
         app:fabSize="normal"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintRight_toRightOf="parent"
@@ -151,7 +151,7 @@
             android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
             android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
             android:clickable="true"
-            app:backgroundTint="@color/background_normal"
+            app:backgroundTint="?attr/colorBackgroundFloating"
             app:fabSize="mini"
             app:srcCompat="@drawable/writer"
             app:useCompatPadding="true" />
@@ -183,7 +183,7 @@
             android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
             android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
             android:clickable="true"
-            app:backgroundTint="@color/background_normal"
+            app:backgroundTint="?attr/colorBackgroundFloating"
             app:fabSize="mini"
             app:srcCompat="@drawable/impress"
             app:useCompatPadding="true" />
@@ -215,7 +215,7 @@
             android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
             android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
             android:clickable="true"
-            app:backgroundTint="@color/background_normal"
+            app:backgroundTint="?attr/colorBackgroundFloating"
             app:fabSize="mini"
             app:srcCompat="@drawable/calc"
             app:useCompatPadding="true" />
@@ -247,7 +247,7 @@
             android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
             android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
             android:clickable="true"
-            app:backgroundTint="@color/background_normal"
+            app:backgroundTint="?attr/colorBackgroundFloating"
             app:fabSize="mini"
             app:srcCompat="@drawable/draw"
             app:useCompatPadding="true" />
diff --git a/android/source/res/layout/item_recent_files.xml 
b/android/source/res/layout/item_recent_files.xml
index b374ba56f04f..f13839b44b73 100644
--- a/android/source/res/layout/item_recent_files.xml
+++ b/android/source/res/layout/item_recent_files.xml
@@ -11,7 +11,6 @@
     android:layout_width="match_parent"
     android:layout_height="48dp"
     android:orientation="horizontal"
-    android:background="?android:attr/selectableItemBackground"
     android:layout_marginStart="@dimen/list_item_margin"
     android:layout_marginLeft="@dimen/list_item_margin"
     android:layout_marginEnd="@dimen/list_item_margin"
diff --git a/android/source/res/values/themes.xml 
b/android/source/res/values/themes.xml
index 8576f9c221ec..e26bee22eb31 100644
--- a/android/source/res/values/themes.xml
+++ b/android/source/res/values/themes.xml
@@ -7,7 +7,7 @@
 
     <style name="ListItemText">
         <item name="android:gravity">center_vertical</item>
-        <item name="android:textColor">@android:color/black</item>
+        <item name="android:textColor">?android:attr/textColorPrimary</item>
         <item name="android:textSize">14sp</item>
     </style>
 
commit 10cdb834281c0c37e6966173e67150e39917ccd7
Author:     Michael Weghorn <[email protected]>
AuthorDate: Tue Nov 28 10:17:52 2023 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Nov 30 12:15:54 2023 +0100

    tdf#124480 android: Use MaterialToolbar and drop manual bg color
    
    This ensures these 2 toolbars will also use the correct color
    in dark mode once support for that is added in a subsequent
    commit.
    
    Change-Id: Idcea5096c4e4bdf8ddc6b28df0fc6df05074980b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160066
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/android/source/res/layout/activity_document_browser.xml 
b/android/source/res/layout/activity_document_browser.xml
index c4dcf3f0c8c1..e47426871f72 100644
--- a/android/source/res/layout/activity_document_browser.xml
+++ b/android/source/res/layout/activity_document_browser.xml
@@ -14,12 +14,11 @@
     android:orientation="vertical">
 
     <!-- The toolbar -->
-    <androidx.appcompat.widget.Toolbar
+    <com.google.android.material.appbar.MaterialToolbar
         android:id="@+id/toolbar"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:elevation="3dp"
-        android:background="@color/toolbar_background"
         app:theme="@style/LibreOfficeTheme.Toolbar"
         tools:theme="@style/LibreOfficeTheme.Toolbar"
         app:popupTheme="@style/LibreOfficeTheme"
@@ -30,7 +29,7 @@
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toTopOf="parent">
 
-    </androidx.appcompat.widget.Toolbar>
+    </com.google.android.material.appbar.MaterialToolbar>
 
 
     <androidx.drawerlayout.widget.DrawerLayout
diff --git a/android/source/res/layout/activity_main.xml 
b/android/source/res/layout/activity_main.xml
index cb43a43a3e1e..590a7de025b4 100644
--- a/android/source/res/layout/activity_main.xml
+++ b/android/source/res/layout/activity_main.xml
@@ -23,12 +23,11 @@
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content">
 
-                <androidx.appcompat.widget.Toolbar
+                <com.google.android.material.appbar.MaterialToolbar
                     android:id="@+id/toolbar"
                     android:layout_width="match_parent"
                     android:layout_height="?attr/actionBarSize"
                     android:elevation="3dp"
-                    android:background="@color/toolbar_background"
                     app:theme="@style/LibreOfficeTheme.Toolbar"
                     tools:theme="@style/LibreOfficeTheme.Toolbar"
                     app:popupTheme="@style/LibreOfficeTheme" />

Reply via email to