|
65 | 65 | import android.view.animation.AccelerateInterpolator; |
66 | 66 | import android.view.animation.Animation; |
67 | 67 | import android.view.animation.AnimationUtils; |
| 68 | +import android.view.animation.DecelerateInterpolator; |
68 | 69 | import android.widget.FrameLayout; |
69 | 70 | import android.widget.ImageView; |
70 | 71 | import android.widget.LinearLayout; |
@@ -230,13 +231,11 @@ public class PhoneStatusBar extends BaseStatusBar { |
230 | 231 | private final Animator.AnimatorListener mMakeIconsInvisible = new AnimatorListenerAdapter() { |
231 | 232 | @Override |
232 | 233 | public void onAnimationEnd(Animator animation) { |
233 | | - mIcons.setVisibility(View.INVISIBLE); |
234 | | - } |
235 | | - }; |
236 | | - private final Animator.AnimatorListener mMakeIconsVisible = new AnimatorListenerAdapter() { |
237 | | - @Override |
238 | | - public void onAnimationEnd(Animator animation) { |
239 | | - mIcons.setVisibility(View.VISIBLE); |
| 234 | + // double-check to avoid races |
| 235 | + if (mIcons.getAlpha() == 0) { |
| 236 | + Slog.d(TAG, "makeIconsInvisible"); |
| 237 | + mIcons.setVisibility(View.INVISIBLE); |
| 238 | + } |
240 | 239 | } |
241 | 240 | }; |
242 | 241 |
|
@@ -968,11 +967,26 @@ public void disable(int state) { |
968 | 967 | if ((diff & StatusBarManager.DISABLE_SYSTEM_INFO) != 0) { |
969 | 968 | mIcons.animate().cancel(); |
970 | 969 | if ((state & StatusBarManager.DISABLE_SYSTEM_INFO) != 0) { |
971 | | - mIcons.animate().alpha(0f).setStartDelay(100).setDuration(200). |
972 | | - setListener(mMakeIconsInvisible).start(); |
| 970 | + if (mTicking) { |
| 971 | + mTicker.halt(); |
| 972 | + } |
| 973 | + mIcons.animate() |
| 974 | + .alpha(0f) |
| 975 | + .translationY(mNaturalBarHeight*0.5f) |
| 976 | + //.setStartDelay(100) |
| 977 | + .setDuration(175) |
| 978 | + .setInterpolator(new DecelerateInterpolator(1.5f)) |
| 979 | + .setListener(mMakeIconsInvisible) |
| 980 | + .start(); |
973 | 981 | } else { |
974 | | - mIcons.animate().alpha(1f).setStartDelay(0).setDuration(300). |
975 | | - setListener(mMakeIconsVisible).start(); |
| 982 | + mIcons.setVisibility(View.VISIBLE); |
| 983 | + mIcons.animate() |
| 984 | + .alpha(1f) |
| 985 | + .translationY(0) |
| 986 | + .setStartDelay(0) |
| 987 | + .setInterpolator(new DecelerateInterpolator(1.5f)) |
| 988 | + .setDuration(175) |
| 989 | + .start(); |
976 | 990 | } |
977 | 991 | } |
978 | 992 |
|
|
0 commit comments