فهرست منبع

Fixed dark theme for toolbar menu

Vadik Sirekanyan 6 سال پیش
والد
کامیت
6cd29a1ef8

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

@@ -17,7 +17,7 @@
             android:id="@+id/toolbar"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            app:popupTheme="@style/ToolbarPopupTheme"
+            app:popupTheme="?attr/toolbar_popup_theme"
             app:title="@string/common.title.app" />
 
     </android.support.design.widget.AppBarLayout>

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

@@ -18,7 +18,7 @@
             android:id="@+id/toolbar"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            app:popupTheme="@style/ToolbarPopupTheme"
+            app:popupTheme="?attr/toolbar_popup_theme"
             tools:title="@string/book.title.add" />
 
     </android.support.design.widget.AppBarLayout>

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

@@ -29,7 +29,7 @@
                 android:layout_width="match_parent"
                 android:layout_height="@dimen/toolbar_height"
                 app:layout_collapseMode="pin"
-                app:popupTheme="@style/ToolbarPopupTheme"
+                app:popupTheme="?attr/toolbar_popup_theme"
                 app:titleMarginStart="@dimen/title_start_margin_collapsed" />
 
         </android.support.design.widget.CollapsingToolbarLayout>

+ 1 - 0
app/src/main/res/values/attrs.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
+    <attr name="toolbar_popup_theme" format="reference" />
     <attr name="bottom_navigation_color" format="reference|color" />
     <attr name="image_placeholder_color" format="reference|color" />
     <attr name="image_dark_placeholder_color" format="reference|color" />

+ 2 - 2
app/src/main/res/values/styles.xml

@@ -30,6 +30,7 @@
         <item name="android:navigationBarColor" tools:targetApi="lollipop">
             @color/light_navigation_bar_color
         </item>
+        <item name="toolbar_popup_theme">@style/ThemeOverlay.AppCompat.Light</item>
     </style>
 
     <style name="DarkAppTheme" parent="Theme.AppCompat.NoActionBar">
@@ -50,6 +51,7 @@
         <item name="android:navigationBarColor" tools:targetApi="lollipop">
             @color/dark_navigation_bar_color
         </item>
+        <item name="toolbar_popup_theme">@style/ThemeOverlay.AppCompat.Dark</item>
     </style>
 
     <style name="ProfileAppTheme" parent="DarkAppTheme">
@@ -65,8 +67,6 @@
 
     <style name="AppBarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
 
-    <style name="ToolbarPopupTheme" parent="@style/ThemeOverlay.AppCompat.Light" />
-
     <style name="AboutItem">
         <item name="android:layout_height">wrap_content</item>
         <item name="android:layout_width">wrap_content</item>