Fix background color.
Fixes b/6961067 funkiness when deleting top item in list view
Change-Id: I41df55ddd309131ba80539372162bee824d2204b
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 308e0be..d2839bc 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -69,4 +69,5 @@
<color name="high_spam_color">#CC0000</color>
<color name="leaveBehindBackground">#5a595a</color>
+ <color name="animating_item_background_color">#7F0099cc</color>
</resources>
diff --git a/src/com/android/mail/browse/ConversationItemView.java b/src/com/android/mail/browse/ConversationItemView.java
index 1bcb9b8..2099ae5 100644
--- a/src/com/android/mail/browse/ConversationItemView.java
+++ b/src/com/android/mail/browse/ConversationItemView.java
@@ -119,6 +119,7 @@
private static int sStandardScaledDimen;
private static int sShrinkAnimationDuration;
private static int sSlideAnimationDuration;
+ private static int sAnimatingBackgroundColor;
// Static paints.
private static TextPaint sPaint = new TextPaint();
@@ -364,6 +365,7 @@
sSendersSplitToken = res.getString(R.string.senders_split_token);
sElidedPaddingToken = res.getString(R.string.elided_padding_token);
sEllipsis = res.getString(R.string.ellipsis);
+ sAnimatingBackgroundColor = res.getColor(R.color.animating_item_background_color);
}
}
@@ -1093,6 +1095,12 @@
}
private void updateBackground(boolean isUnread) {
+ if (mAnimatedHeight != -1) {
+ // If the item is animating, we use a color to avoid shrinking a 9-patch
+ // and getting weird artifacts from the overlap.
+ setBackgroundColor(sAnimatingBackgroundColor);
+ return;
+ }
final boolean isListOnTablet = mTabletDevice && mActivity.getViewMode().isListMode();
if (isUnread) {
if (isListOnTablet) {
@@ -1365,6 +1373,7 @@
int minHeight = ConversationItemViewCoordinates.getMinHeight(mContext,
mActivity.getViewMode());
setMinimumHeight(0);
+ setBackgroundColor(sAnimatingBackgroundColor);
mAnimatedHeight = minHeight;
height.addListener(listener);
height.start();