Merge "Fix UserAvatarView.setDisabled method."
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UserAvatarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UserAvatarView.java
index 4f33d82..fd3c96e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UserAvatarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UserAvatarView.java
@@ -174,6 +174,7 @@
float halfW = getWidth() / 2f;
float halfH = getHeight() / 2f;
float halfSW = Math.min(halfH, halfW);
+ updateDrawableIfDisabled();
if (mBitmap != null && mScale > 0) {
int saveCount = canvas.getSaveCount();
canvas.save();
@@ -249,22 +250,25 @@
return;
}
mIsDisabled = disabled;
+ invalidate();
+ }
+
+ private void updateDrawableIfDisabled() {
int disabledColor = getContext().getColor(R.color.qs_tile_disabled_color);
PorterDuffColorFilter filter = new PorterDuffColorFilter(disabledColor,
PorterDuff.Mode.SRC_ATOP);
if (mBitmap != null) {
- if (disabled) {
+ if (mIsDisabled) {
mBitmapPaint.setColorFilter(filter);
} else {
mBitmapPaint.setColorFilter(null);
}
} else if (mDrawable != null) {
- if (disabled) {
+ if (mIsDisabled) {
mDrawable.setColorFilter(filter);
} else {
mDrawable.setColorFilter(null);
}
}
- invalidate();
}
}