diff options
-rw-r--r-- | core/java/android/transition/Fade.java | 12 | ||||
-rw-r--r-- | core/java/android/transition/Visibility.java | 3 |
2 files changed, 7 insertions, 8 deletions
diff --git a/core/java/android/transition/Fade.java b/core/java/android/transition/Fade.java index 08e27d3..e70dc0c 100644 --- a/core/java/android/transition/Fade.java +++ b/core/java/android/transition/Fade.java @@ -105,7 +105,7 @@ public class Fade extends Visibility { if (DBG) { Log.d(LOG_TAG, "Created animator " + anim); } - FadeAnimatorListener listener = new FadeAnimatorListener(view, endAlpha); + FadeAnimatorListener listener = new FadeAnimatorListener(view); anim.addListener(listener); anim.addPauseListener(listener); return anim; @@ -138,13 +138,11 @@ public class Fade extends Visibility { private static class FadeAnimatorListener extends AnimatorListenerAdapter { private final View mView; - private final float mEndAlpha; private boolean mCanceled = false; - private float mPausedAlpha; + private float mPausedAlpha = -1; - public FadeAnimatorListener(View view, float endAlpha) { + public FadeAnimatorListener(View view) { mView = view; - mEndAlpha = endAlpha; } @Override @@ -158,14 +156,14 @@ public class Fade extends Visibility { @Override public void onAnimationEnd(Animator animator) { if (!mCanceled) { - mView.setTransitionAlpha(mEndAlpha); + mView.setTransitionAlpha(1); } } @Override public void onAnimationPause(Animator animator) { mPausedAlpha = mView.getTransitionAlpha(); - mView.setTransitionAlpha(mEndAlpha); + mView.setTransitionAlpha(1); } @Override diff --git a/core/java/android/transition/Visibility.java b/core/java/android/transition/Visibility.java index 526803a..6e6496c 100644 --- a/core/java/android/transition/Visibility.java +++ b/core/java/android/transition/Visibility.java @@ -347,10 +347,11 @@ public abstract class Visibility extends Transition { } if (viewToKeep != null) { + int originalVisibility = viewToKeep.getVisibility(); viewToKeep.setVisibility(View.VISIBLE); Animator animator = onDisappear(sceneRoot, viewToKeep, startValues, endValues); if (animator == null) { - viewToKeep.setVisibility(finalVisibility); + viewToKeep.setVisibility(originalVisibility); } else { final View finalViewToKeep = viewToKeep; animator.addListener(new AnimatorListenerAdapter() { |