Chromium Code Reviews| Index: remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| diff --git a/remoting/android/java/src/org/chromium/chromoting/Desktop.java b/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| index c115749677ffb9dab8db7ecd28567fc8e5b79200..e340f51af4f9b49eacd5dc460e41674f49c989fb 100644 |
| --- a/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| +++ b/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| @@ -18,6 +18,8 @@ import android.view.MotionEvent; |
| import android.view.View; |
| import android.view.View.OnLayoutChangeListener; |
| import android.view.View.OnTouchListener; |
| +import android.view.animation.Animation; |
| +import android.view.animation.AnimationUtils; |
| import android.view.inputmethod.InputMethodManager; |
| import org.chromium.chromoting.help.HelpContext; |
| @@ -49,6 +51,9 @@ public class Desktop |
| /** The amount of time to wait to hide the ActionBar after user input is seen. */ |
| private static final int ACTIONBAR_AUTO_HIDE_DELAY_MS = 3000; |
| + /** Animation duration for fade-in and fade-out. */ |
|
joedow
2016/10/05 22:10:25
I'd change this to 'Duration for fade-in and fade-
Yuwei
2016/10/05 22:22:22
Done.
|
| + private static final int ACTIONBAR_ANIMATION_DURATION_MS = 250; |
| + |
| private final Event.Raisable<SystemUiVisibilityChangedEventParameter> |
| mOnSystemUiVisibilityChanged = new Event.Raisable<>(); |
| @@ -78,6 +83,12 @@ public class Desktop |
| private DesktopView mRemoteHostDesktop; |
| + private Animation createAnimation(int animationId) { |
|
joedow
2016/10/05 22:10:25
rename to 'createToolbarVisibilityAnimation'? It
Yuwei
2016/10/05 22:22:22
Done.
|
| + Animation animation = AnimationUtils.loadAnimation(this, animationId); |
| + animation.setDuration(ACTIONBAR_ANIMATION_DURATION_MS); |
| + return animation; |
| + } |
| + |
| /** Called when the activity is first created. */ |
| @Override |
| public void onCreate(Bundle savedInstanceState) { |
| @@ -400,6 +411,8 @@ public class Desktop |
| /** Shows the action bar without changing SystemUiVisibility. */ |
| private void showActionBar() { |
| + mToolbar.startAnimation(createAnimation(android.R.anim.fade_in)); |
| + |
| getSupportActionBar().show(); |
| startActionBarAutoHideTimer(); |
| } |
| @@ -437,6 +450,8 @@ public class Desktop |
| /** Hides the action bar without changing SystemUiVisibility. */ |
| private void hideActionBar() { |
| + mToolbar.startAnimation(createAnimation(android.R.anim.fade_out)); |
| + |
| getSupportActionBar().hide(); |
| stopActionBarAutoHideTimer(); |
| } |