OSDN Git Service

Change color of background for popup window
authorMill Chen <millchen@google.com>
Thu, 2 May 2019 14:30:58 +0000 (22:30 +0800)
committerMill Chen <millchen@google.com>
Fri, 3 May 2019 13:55:18 +0000 (21:55 +0800)
Add an attribute colorPopupBackground and set it in both Material and
DeviceDefault themes. This attribute in the Material theme will be set
to colorBackground and it will be colorBackgroundFloating in the
DeviceDefault theme.

Bug: 129993543
Test: visual
Change-Id: Id0572e38dd550930873d59161d84d0ab79283ee2

core/res/res/drawable/popup_background_material.xml
core/res/res/values/attrs.xml
core/res/res/values/themes_device_defaults.xml
core/res/res/values/themes_material.xml

index b1f0cf5..9ad7bfc 100644 (file)
@@ -20,6 +20,6 @@
     <corners
             android:radius="2dp" />
     <solid
-            android:color="?attr/colorBackground" />
+            android:color="?attr/colorPopupBackground" />
 
 </shape>
index 489a08a..dffc2e9 100644 (file)
@@ -87,6 +87,8 @@
              theme does not set this value, meaning it is based on whether the
              window is floating. -->
         <attr name="backgroundDimEnabled" format="boolean" />
+        <!-- Color of background imagery used for popup windows. -->
+        <attr name="colorPopupBackground" format="color" />
 
         <!-- =========== -->
         <!-- Text styles -->
index 2e98460..08d6d06 100644 (file)
@@ -216,6 +216,7 @@ easier.
         <item name="colorAccent">@color/accent_device_default_dark</item>
         <item name="colorError">@color/error_color_device_default_dark</item>
         <item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
+        <item name="colorPopupBackground">?attr/colorBackgroundFloating</item>
     </style>
 
     <style name="Theme.DeviceDefault" parent="Theme.DeviceDefaultBase" />
@@ -943,6 +944,7 @@ easier.
         <item name="colorAccent">@color/accent_device_default_light</item>
         <item name="colorError">@color/error_color_device_default_light</item>
         <item name="colorBackgroundFloating">@color/background_floating_device_default_light</item>
+        <item name="colorPopupBackground">?attr/colorBackgroundFloating</item>
     </style>
 
     <!-- Variant of the DeviceDefault (light) theme that has a solid (opaque) action bar with an
index 6b7698e..6337db1 100644 (file)
@@ -52,6 +52,7 @@ please see themes_device_defaults.xml.
         <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_material_dark</item>
         <item name="backgroundDimAmount">0.6</item>
         <item name="colorError">@color/error_color_material_dark</item>
+        <item name="colorPopupBackground">?attr/colorBackground</item>
 
         <!-- Text styles -->
         <item name="textAppearance">@style/TextAppearance.Material</item>
@@ -422,6 +423,7 @@ please see themes_device_defaults.xml.
         <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_material_light</item>
         <item name="backgroundDimAmount">0.6</item>
         <item name="colorError">@color/error_color_material_light</item>
+        <item name="colorPopupBackground">?attr/colorBackground</item>
 
         <!-- Text styles -->
         <item name="textAppearance">@style/TextAppearance.Material</item>