Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Unified Diff: remoting/android/java/src/org/chromium/chromoting/Desktop.java

Issue 2393073003: [Remoting Android] Fading transition animation for desktop actionbar (Closed)
Patch Set: Reviewer's Feedback Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4c0b26e91fcc27d94c626fbcb2a75be76de35c83 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;
+ /** Duration for fade-in and fade-out animations for the ActionBar. */
+ private static final int ACTIONBAR_ANIMATION_DURATION_MS = 250;
+
private final Event.Raisable<SystemUiVisibilityChangedEventParameter>
mOnSystemUiVisibilityChanged = new Event.Raisable<>();
@@ -400,6 +405,10 @@ public class Desktop
/** Shows the action bar without changing SystemUiVisibility. */
private void showActionBar() {
+ Animation animation = AnimationUtils.loadAnimation(this, android.R.anim.fade_in);
+ animation.setDuration(ACTIONBAR_ANIMATION_DURATION_MS);
+ mToolbar.startAnimation(animation);
+
getSupportActionBar().show();
startActionBarAutoHideTimer();
}
@@ -437,6 +446,10 @@ public class Desktop
/** Hides the action bar without changing SystemUiVisibility. */
private void hideActionBar() {
+ Animation animation = AnimationUtils.loadAnimation(this, android.R.anim.fade_out);
+ animation.setDuration(ACTIONBAR_ANIMATION_DURATION_MS);
+ mToolbar.startAnimation(animation);
+
getSupportActionBar().hide();
stopActionBarAutoHideTimer();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698