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() {
|
private final AnimatorListenerAdapter mFadeListener = new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
mFadeAnimator = null;
|
||||||
setVisibility(getAlpha() == 1 ? View.VISIBLE : View.INVISIBLE);
|
setVisibility(getAlpha() == 1 ? View.VISIBLE : View.INVISIBLE);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -143,7 +144,6 @@ public class ButtonDispatcher {
|
|||||||
if (mVisibility == visibility) return;
|
if (mVisibility == visibility) return;
|
||||||
if (mFadeAnimator != null) {
|
if (mFadeAnimator != null) {
|
||||||
mFadeAnimator.cancel();
|
mFadeAnimator.cancel();
|
||||||
mFadeAnimator = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mVisibility = visibility;
|
mVisibility = visibility;
|
||||||
@@ -176,13 +176,13 @@ public class ButtonDispatcher {
|
|||||||
if (mFadeAnimator != null) {
|
if (mFadeAnimator != null) {
|
||||||
mFadeAnimator.cancel();
|
mFadeAnimator.cancel();
|
||||||
}
|
}
|
||||||
|
setVisibility(View.VISIBLE);
|
||||||
mFadeAnimator = ValueAnimator.ofFloat(getAlpha(), alpha);
|
mFadeAnimator = ValueAnimator.ofFloat(getAlpha(), alpha);
|
||||||
mFadeAnimator.setDuration(duration);
|
mFadeAnimator.setDuration(duration);
|
||||||
mFadeAnimator.setInterpolator(getAlpha() < alpha ? ALPHA_IN : ALPHA_OUT);
|
mFadeAnimator.setInterpolator(getAlpha() < alpha ? ALPHA_IN : ALPHA_OUT);
|
||||||
mFadeAnimator.addListener(mFadeListener);
|
mFadeAnimator.addListener(mFadeListener);
|
||||||
mFadeAnimator.addUpdateListener(mAlphaListener);
|
mFadeAnimator.addUpdateListener(mAlphaListener);
|
||||||
mFadeAnimator.start();
|
mFadeAnimator.start();
|
||||||
setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
} else {
|
||||||
mAlpha = alpha;
|
mAlpha = alpha;
|
||||||
final int N = mViews.size();
|
final int N = mViews.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user