Try to make dividers stand out less as items shrink.
Use a color when shrinking leave behind items so we dont
get weird artifacts from the 9tile.
Change-Id: I4c3765a2f04eabaa2d358cf5e7d6f2523f672da0
diff --git a/res/values/colors.xml b/res/values/colors.xml
index d2839bc..844d933 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -35,7 +35,8 @@
<color name="light_text_color">#ff666666</color>
<color name="default_folder_background_color">#f1f5ec</color>
<color name="default_folder_foreground_color">#888888</color>
- <color name="conversation_list_background_color">#bbbbbb</color>
+ <color name="conversation_list_background_color">#dddddd</color>
+ <color name="swiped_bg_color">#ff999999</color>
<!-- Compose colors -->
<color name="compose_label_text">#aaaaaa</color>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 5973db3..64c685f 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -188,7 +188,7 @@
<style name="ConversationListFade" parent="@android:style/Widget.Holo.Light.ListView">
<item name="android:cacheColorHint">@android:color/transparent</item>
- <item name="android:divider">#dddddd</item>
+ <item name="android:divider">@android:color/transparent</item>
<item name="android:dividerHeight">1dip</item>
</style>
diff --git a/src/com/android/mail/ui/LeaveBehindItem.java b/src/com/android/mail/ui/LeaveBehindItem.java
index 5572623..9ff11c2 100644
--- a/src/com/android/mail/ui/LeaveBehindItem.java
+++ b/src/com/android/mail/ui/LeaveBehindItem.java
@@ -48,6 +48,7 @@
private TextView mText;
private static int sShrinkAnimationDuration = -1;
private static int sFadeInAnimationDuration = -1;
+ private static int sSwipedBgColor = -1;
public LeaveBehindItem(Context context) {
this(context, null);
@@ -64,6 +65,7 @@
R.integer.shrink_animation_duration);
sFadeInAnimationDuration = context.getResources().getInteger(
R.integer.fade_in_animation_duration);
+ sSwipedBgColor = context.getResources().getColor(R.color.swiped_bg_color);
}
}
@@ -194,6 +196,8 @@
ObjectAnimator height = ObjectAnimator.ofInt(this, "animatedHeight", start, end);
mAnimatedHeight = start;
mWidth = getMeasuredWidth();
+ // Use a color instead of a 9 patch to avoid weird artifacts when animating.
+ setBackgroundColor(sSwipedBgColor);
height.setInterpolator(new DecelerateInterpolator(2.0f));
height.addListener(listener);
height.setDuration(sShrinkAnimationDuration);