Commit 9d6b75af authored by Hazem Ashmawy's avatar Hazem Ashmawy Committed by Commit Bot

[AW] DevUI: Fix shared alert icon color

Drawables all share the same state across the app. Changing the icon
color in the bottom nav bar when switching fragments changes in all
Drawables using the same resource. Calling Drawable#mutate() makes
this Drawable mutable so that it doesn't share its state anymore.

Fixed: 1069679
Test: Switch fragments and observe error view icon color
Change-Id: I7c2d3c1ace7b3119de91e959ee4c5b9b3321a2dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2161228
Auto-Submit: Hazem Ashmawy <hazems@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762101}
parent a3360541
......@@ -112,6 +112,7 @@ public class MainActivity extends FragmentActivity {
: getResources().getColor(R.color.navigation_unselected);
for (Drawable drawable : textView.getCompoundDrawables()) {
if (drawable != null) {
drawable.mutate();
drawable.setColorFilter(
new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment