Updates the background of the clear all button for low ram devices

When the background changes on device, update the background color of
the clear all button on low ram devices to match.

Test: manual - change wallpaper color to dark/light, open recents
Change-Id: Ie91bc2eeb77307aa63055334a1ff1727026e5094
Fixes: 65261858
This commit is contained in:
Matthew Ng
2017-09-01 17:56:35 -07:00
parent f3f7a101fb
commit b44cceaef6
4 changed files with 12 additions and 0 deletions

View File

@@ -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" />

View File

@@ -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 -->

View File

@@ -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>

View File

@@ -205,6 +205,10 @@ public class RecentsView extends FrameLayout {
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