Bladeren bron

Fix common toolbar popup menu text color (fixes #2695)

arkon 5 jaren geleden
bovenliggende
commit
b9ea6e8d96

+ 3 - 2
app/src/main/res/layout/common_action_toolbar.xml

@@ -4,7 +4,7 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content">
 
-    <androidx.appcompat.widget.Toolbar
+    <com.google.android.material.appbar.MaterialToolbar
         android:id="@+id/common_action_toolbar"
         android:layout_width="match_parent"
         android:layout_height="?attr/actionBarSize"
@@ -12,6 +12,7 @@
         android:background="?attr/colorPrimary"
         android:theme="?attr/actionBarTheme"
         android:visibility="gone"
+        android:elevation="2dp"
         app:contentInsetStart="8dp"
         app:contentInsetEnd="8dp">
 
@@ -20,6 +21,6 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent" />
 
-    </androidx.appcompat.widget.Toolbar>
+    </com.google.android.material.appbar.MaterialToolbar>
 
 </FrameLayout>

+ 1 - 1
app/src/main/res/layout/main_activity.xml

@@ -16,7 +16,7 @@
             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"

+ 1 - 1
app/src/main/res/layout/reader_activity.xml

@@ -48,7 +48,7 @@
         android:visibility="invisible"
         tools:visibility="visible">
 
-        <androidx.appcompat.widget.Toolbar
+        <com.google.android.material.appbar.MaterialToolbar
             android:id="@+id/toolbar"
             android:layout_width="match_parent"
             android:layout_height="?attr/actionBarSize"

+ 1 - 1
app/src/main/res/layout/webview_activity.xml

@@ -10,7 +10,7 @@
         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"

+ 8 - 4
app/src/main/res/values/styles.xml

@@ -118,6 +118,14 @@
         <item name="android:textColor">?android:attr/textColorHint</item>
     </style>
 
+    <style name="TextAppearance.Widget.Button" parent="TextAppearance.MaterialComponents.Button">
+        <item name="android:letterSpacing">0</item>
+    </style>
+
+    <style name="TextAppearance.Widget.Menu" parent="TextAppearance.AppCompat.Menu">
+        <item name="android:textColor">?attr/colorOnBackground</item>
+    </style>
+
     <!--=======-->
     <!--Widgets-->
     <!--=======-->
@@ -189,10 +197,6 @@
     <!--==============-->
     <!--Widgets.Button-->
     <!--==============-->
-    <style name="TextAppearance.Widget.Button" parent="TextAppearance.MaterialComponents.Button">
-        <item name="android:letterSpacing">0</item>
-    </style>
-
     <style name="Theme.Widget.Button" parent="Widget.MaterialComponents.Button.TextButton">
         <item name="android:textColor">?attr/colorOnSurface</item>
     </style>

+ 4 - 0
app/src/main/res/values/themes.xml

@@ -22,6 +22,7 @@
         <item name="colorOnSecondary">@color/textColorPrimaryDark</item>
         <item name="colorSurface">@color/dialogLight</item>
         <item name="colorOnSurface">@color/textColorPrimaryLight</item>
+        <item name="colorOnBackground">@color/textColorPrimaryLight</item>
         <item name="colorAccent">@color/colorAccentLight</item>
 
         <!-- Base background/text colors -->
@@ -50,6 +51,7 @@
         <item name="dialogTheme">@style/Theme.AlertDialog.Light</item>
         <item name="alertDialogTheme">@style/Theme.AlertDialog.Dark</item>
         <item name="textAppearanceButton">@style/TextAppearance.Widget.Button</item>
+        <item name="android:itemTextAppearance">@style/TextAppearance.Widget.Menu</item>
 
         <!-- Custom Attributes-->
         <item name="selectable_library_drawable">@drawable/library_item_selector_light</item>
@@ -76,6 +78,7 @@
         <item name="colorOnSecondary">@color/textColorPrimaryDark</item>
         <item name="colorSurface">@color/dialogDark</item>
         <item name="colorOnSurface">@color/textColorPrimaryDark</item>
+        <item name="colorOnBackground">@color/textColorPrimaryDark</item>
         <item name="colorAccent">@color/colorAccentDark</item>
 
         <!-- Handles RTL text -->
@@ -108,6 +111,7 @@
         <item name="dialogTheme">@style/Theme.AlertDialog.Dark</item>
         <item name="alertDialogTheme">@style/Theme.AlertDialog.Dark</item>
         <item name="textAppearanceButton">@style/TextAppearance.Widget.Button</item>
+        <item name="android:itemTextAppearance">@style/TextAppearance.Widget.Menu</item>
 
         <item name="md_background_color">?attr/colorSurface</item>