Merge "Fix back button not disappearing" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e1bdc4b0e8
@@ -61,6 +61,7 @@ public class ButtonDispatcher {
|
||||
private final AnimatorListenerAdapter mFadeListener = new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mFadeAnimator = null;
|
||||
setVisibility(getAlpha() == 1 ? View.VISIBLE : View.INVISIBLE);
|
||||
}
|
||||
};
|
||||
@@ -143,7 +144,6 @@ public class ButtonDispatcher {
|
||||
if (mVisibility == visibility) return;
|
||||
if (mFadeAnimator != null) {
|
||||
mFadeAnimator.cancel();
|
||||
mFadeAnimator = null;
|
||||
}
|
||||
|
||||
mVisibility = visibility;
|
||||
@@ -176,13 +176,13 @@ public class ButtonDispatcher {
|
||||
if (mFadeAnimator != null) {
|
||||
mFadeAnimator.cancel();
|
||||
}
|
||||
setVisibility(View.VISIBLE);
|
||||
mFadeAnimator = ValueAnimator.ofFloat(getAlpha(), alpha);
|
||||
mFadeAnimator.setDuration(duration);
|
||||
mFadeAnimator.setInterpolator(getAlpha() < alpha ? ALPHA_IN : ALPHA_OUT);
|
||||
mFadeAnimator.addListener(mFadeListener);
|
||||
mFadeAnimator.addUpdateListener(mAlphaListener);
|
||||
mFadeAnimator.start();
|
||||
setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mAlpha = alpha;
|
||||
final int N = mViews.size();
|
||||
|
||||
Reference in New Issue
Block a user