Fix QuickContact header color on avatar removal
In landscape mode setting header color may not reflect the avatar
change. This fix always set the header tint, and let the photo view
decide to use it or not when its setImageDrawable() gets called.
Bug: 32380331
Test: manual test on Nexus 5x with NMF following repro steps observing
that the photo view restore the colored default drawable.
Change-Id: I4b54929bd34f168440e7bdb554ca37804a6a9bd7
diff --git a/src/com/android/contacts/widget/MultiShrinkScroller.java b/src/com/android/contacts/widget/MultiShrinkScroller.java
index b1deb90..b86bebf 100644
--- a/src/com/android/contacts/widget/MultiShrinkScroller.java
+++ b/src/com/android/contacts/widget/MultiShrinkScroller.java
@@ -1141,6 +1141,10 @@
// Let's keep an eye on how long this method takes to complete.
Trace.beginSection("updatePhotoTintAndDropShadow");
+ // Tell the photo view what tint we are trying to achieve. Depending on the type of
+ // drawable used, the photo view may or may not use this tint.
+ mPhotoView.setTint(mHeaderTintColor);
+
if (mIsTwoPanel && !mPhotoView.isBasedOffLetterTile()) {
// When in two panel mode, UX considers photo tinting unnecessary for non letter
// tile photos.
@@ -1206,9 +1210,6 @@
// TODO: remove re-allocation of ColorMatrixColorFilter objects (b/17627000)
mPhotoView.setColorFilter(new ColorMatrixColorFilter(mColorMatrix));
- // Tell the photo view what tint we are trying to achieve. Depending on the type of
- // drawable used, the photo view may or may not use this tint.
- mPhotoView.setTint(mHeaderTintColor);
mTitleGradientDrawable.setAlpha(gradientAlpha);
mActionBarGradientDrawable.setAlpha(gradientAlpha);