diff options
| author | ezio84 <brabus84@gmail.com> | 2018-08-25 14:08:46 +0200 |
|---|---|---|
| committer | ezio84 <brabus84@gmail.com> | 2018-08-25 14:08:46 +0200 |
| commit | 6edf2d4158e2b193a45ff30cd57cc9918749e6e6 (patch) | |
| tree | 3294a1c23e9f37ab842f552f7250ea7c358958f3 | |
| parent | c86bb8b24f4b930e32822ebef220d090c5ece917 (diff) | |
Smartbar rotation lock button: add a little fade in/out
| -rw-r--r-- | src/com/android/systemui/navigation/smartbar/SmartBarView.java | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/com/android/systemui/navigation/smartbar/SmartBarView.java b/src/com/android/systemui/navigation/smartbar/SmartBarView.java index d8f906c..d1c749d 100644 --- a/src/com/android/systemui/navigation/smartbar/SmartBarView.java +++ b/src/com/android/systemui/navigation/smartbar/SmartBarView.java @@ -428,8 +428,32 @@ public class SmartBarView extends BaseNavigationBar { } private void setRotationButtonVisibility(View currentOrHidden, int visibility) { - ViewGroup contextRight = (ViewGroup)currentOrHidden.findViewWithTag(Res.Softkey.CONTEXT_VIEW_RIGHT); - contextRight.findViewWithTag(Res.Softkey.ROTATION_BUTTON).setVisibility(visibility); + final ViewGroup contextRight = (ViewGroup)currentOrHidden.findViewWithTag(Res.Softkey.CONTEXT_VIEW_RIGHT); + View current = contextRight.findViewWithTag(Res.Softkey.ROTATION_BUTTON); + if (visibility == View.VISIBLE) { + current.setVisibility(View.VISIBLE); + current.setAlpha(0.0f); + current.animate() + .setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator _a) { + } + }) + .alpha(1.0f) + .setDuration(100) + .start(); + } else { + current.animate() + .alpha(0.0f) + .setDuration(100) + .setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator _a) { + current.setVisibility(View.INVISIBLE); + } + }) + .start(); + } } @Override |
