Merge "Updates the background of the clear all button for low ram devices" into oc-mr1-dev
diff --git a/packages/SystemUI/res/values/attrs.xml b/packages/SystemUI/res/values/attrs.xml
index 745d6015..a923f0b 100644
--- a/packages/SystemUI/res/values/attrs.xml
+++ b/packages/SystemUI/res/values/attrs.xml
@@ -34,6 +34,7 @@
<attr name="recentItemLayout" format="reference" />
<!-- Style for the "Clear all" button. -->
<attr name="clearAllStyle" format="reference" />
+ <attr name="clearAllBackgroundColor" format="reference" />
</declare-styleable>
<declare-styleable name="DeadZone">
<attr name="minSize" format="dimension" />
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index f72f379..f244d88 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -60,6 +60,11 @@
<!-- The background color for the freeform workspace. -->
<color name="recents_freeform_workspace_bg_color">#33FFFFFF</color>
+ <!-- The background color for clear all button on light backgrounds if not transparent. -->
+ <color name="recents_clear_all_button_bg_light_color">#CCFFFFFF</color>
+ <!-- The background color for clear all button on dark backgrounds if not transparent. -->
+ <color name="recents_clear_all_button_bg_dark_color">#CC000000</color>
+
<color name="keyguard_affordance">#ffffffff</color>
<!-- The color of the legacy notification background -->
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 2199fff..90c5977 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -34,11 +34,13 @@
<item name="android:windowShowWallpaper">true</item>
<item name="android:windowDisablePreview">true</item>
<item name="clearAllStyle">@style/ClearAllButtonDefaultMargins</item>
+ <item name="clearAllBackgroundColor">@color/recents_clear_all_button_bg_dark_color</item>
<item name="wallpaperTextColor">@*android:color/primary_text_material_dark</item>
<item name="wallpaperTextColorSecondary">@*android:color/secondary_text_material_dark</item>
</style>
<style name="RecentsTheme.Wallpaper.Light">
+ <item name="clearAllBackgroundColor">@color/recents_clear_all_button_bg_light_color</item>
<item name="wallpaperTextColor">@*android:color/primary_text_material_light</item>
<item name="wallpaperTextColorSecondary">@*android:color/secondary_text_material_light</item>
</style>
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index 71f06cb..09e712c 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -205,6 +205,10 @@
mStackButtonShadowDistance.x, mStackButtonShadowDistance.y,
mStackButtonShadowColor);
}
+ if (Recents.getConfiguration().isLowRamDevice) {
+ int bgColor = Utils.getColorAttr(mContext, R.attr.clearAllBackgroundColor);
+ mStackActionButton.setBackgroundColor(bgColor);
+ }
}
// Let's also require dark status and nav bars if the text is dark