summaryrefslogtreecommitdiffstats
path: root/src/com/android/mail/ui/LeaveBehindItem.java
diff options
context:
space:
mode:
authormindyp <mindyp@google.com>2012-11-26 09:25:25 -0800
committermindyp <mindyp@google.com>2012-11-26 09:25:25 -0800
commite358ed5c4ed1b172f5eae98f97919a8e471c98dc (patch)
tree5ddd498900ff34a02aba8723914db15742309e0c /src/com/android/mail/ui/LeaveBehindItem.java
parent6138d1ecd00b34503d127e454f9d29c63ad720de (diff)
downloadandroid_packages_apps_UnifiedEmail-e358ed5c4ed1b172f5eae98f97919a8e471c98dc.tar.gz
android_packages_apps_UnifiedEmail-e358ed5c4ed1b172f5eae98f97919a8e471c98dc.tar.bz2
android_packages_apps_UnifiedEmail-e358ed5c4ed1b172f5eae98f97919a8e471c98dc.zip
Correct issues with fading in text when there are other leave behind items.
1) delays the start of the fade in animation for the text of the new item until the previous leave behind item has shrunk away 2) corrects bug where the opacity of the text of the leave behind item was not being reset 3) corrects bug where the variable tracking if an item had completed fading in text was not being correctly reset Fixes b/7172273 [polish] "Archived... Undo" UI jumps around when archiving multiple messages in sequence Change-Id: Id911fdacd41892d9c0a8377c775ef7ba5d79703e
Diffstat (limited to 'src/com/android/mail/ui/LeaveBehindItem.java')
-rw-r--r--src/com/android/mail/ui/LeaveBehindItem.java30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/com/android/mail/ui/LeaveBehindItem.java b/src/com/android/mail/ui/LeaveBehindItem.java
index ec38c8cff..ef3d1ab46 100644
--- a/src/com/android/mail/ui/LeaveBehindItem.java
+++ b/src/com/android/mail/ui/LeaveBehindItem.java
@@ -17,6 +17,7 @@
package com.android.mail.ui;
+import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.Animator.AnimatorListener;
import android.content.Context;
@@ -38,7 +39,7 @@ import com.android.mail.utils.Utils;
import com.google.common.collect.ImmutableList;
public class LeaveBehindItem extends FrameLayout implements OnClickListener,
- SwipeableItemView {
+ SwipeableItemView, AnimatorListener {
private ToastBarOperation mUndoOp;
private Account mAccount;
@@ -174,12 +175,17 @@ public class LeaveBehindItem extends FrameLayout implements OnClickListener,
}
}
- public void startFadeInAnimation() {
+ public void startFadeInAnimation(boolean delay) {
if (!mFadingInText) {
mFadingInText = true;
final float start = 0;
final float end = 1.0f;
ObjectAnimator fadeIn = ObjectAnimator.ofFloat(mText, "alpha", start, end);
+ mText.setAlpha(0);
+ fadeIn.addListener(this);
+ if (delay) {
+ fadeIn.setStartDelay(sShrinkAnimationDuration);
+ }
fadeIn.setInterpolator(new DecelerateInterpolator(2.0f));
fadeIn.setDuration(sFadeInAnimationDuration);
fadeIn.start();
@@ -223,4 +229,24 @@ public class LeaveBehindItem extends FrameLayout implements OnClickListener,
public float getMinAllowScrollDistance() {
return sScrollSlop;
}
+
+ @Override
+ public void onAnimationCancel(Animator arg0) {
+ // Do nothing.
+ }
+
+ @Override
+ public void onAnimationEnd(Animator arg0) {
+ mFadingInText = false;
+ }
+
+ @Override
+ public void onAnimationRepeat(Animator arg0) {
+ // Do nothing.
+ }
+
+ @Override
+ public void onAnimationStart(Animator arg0) {
+ // Do nothing.
+ }
}