am 85978d7c: am a3234f01: am 9c76f61d: Merge "DO NOT MERGE: Reduce delay of floating toolbar appearance." into mnc-dr-dev
* commit '85978d7c36e94f107bd72166bc18f893b4817cf9': DO NOT MERGE: Reduce delay of floating toolbar appearance.
This commit is contained in:
@@ -35,7 +35,7 @@ import java.util.Arrays;
|
|||||||
public class FloatingActionMode extends ActionMode {
|
public class FloatingActionMode extends ActionMode {
|
||||||
|
|
||||||
private static final int MAX_HIDE_DURATION = 3000;
|
private static final int MAX_HIDE_DURATION = 3000;
|
||||||
private static final int MOVING_HIDE_DELAY = 300;
|
private static final int MOVING_HIDE_DELAY = 50;
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final ActionMode.Callback2 mCallback;
|
private final ActionMode.Callback2 mCallback;
|
||||||
@@ -181,7 +181,6 @@ public class FloatingActionMode extends ActionMode {
|
|||||||
// Content rect is moving.
|
// Content rect is moving.
|
||||||
mOriginatingView.removeCallbacks(mMovingOff);
|
mOriginatingView.removeCallbacks(mMovingOff);
|
||||||
mFloatingToolbarVisibilityHelper.setMoving(true);
|
mFloatingToolbarVisibilityHelper.setMoving(true);
|
||||||
mFloatingToolbarVisibilityHelper.updateToolbarVisibility();
|
|
||||||
mOriginatingView.postDelayed(mMovingOff, MOVING_HIDE_DELAY);
|
mOriginatingView.postDelayed(mMovingOff, MOVING_HIDE_DELAY);
|
||||||
|
|
||||||
mFloatingToolbar.setContentRect(mContentRectOnScreen);
|
mFloatingToolbar.setContentRect(mContentRectOnScreen);
|
||||||
@@ -189,9 +188,9 @@ public class FloatingActionMode extends ActionMode {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mFloatingToolbarVisibilityHelper.setOutOfBounds(true);
|
mFloatingToolbarVisibilityHelper.setOutOfBounds(true);
|
||||||
mFloatingToolbarVisibilityHelper.updateToolbarVisibility();
|
|
||||||
mContentRectOnScreen.setEmpty();
|
mContentRectOnScreen.setEmpty();
|
||||||
}
|
}
|
||||||
|
mFloatingToolbarVisibilityHelper.updateToolbarVisibility();
|
||||||
|
|
||||||
mPreviousContentRectOnScreen.set(mContentRectOnScreen);
|
mPreviousContentRectOnScreen.set(mContentRectOnScreen);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1488,10 +1488,9 @@ public final class FloatingToolbar {
|
|||||||
private static AnimatorSet createEnterAnimation(View view) {
|
private static AnimatorSet createEnterAnimation(View view) {
|
||||||
AnimatorSet animation = new AnimatorSet();
|
AnimatorSet animation = new AnimatorSet();
|
||||||
animation.playTogether(
|
animation.playTogether(
|
||||||
ObjectAnimator.ofFloat(view, View.ALPHA, 0, 1).setDuration(200),
|
ObjectAnimator.ofFloat(view, View.ALPHA, 0, 1).setDuration(150),
|
||||||
// Make sure that view.x is always fixed throughout the duration of this animation.
|
// Make sure that view.x is always fixed throughout the duration of this animation.
|
||||||
ObjectAnimator.ofFloat(view, View.X, view.getX(), view.getX()));
|
ObjectAnimator.ofFloat(view, View.X, view.getX(), view.getX()));
|
||||||
animation.setStartDelay(50);
|
|
||||||
return animation;
|
return animation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1506,7 +1505,7 @@ public final class FloatingToolbar {
|
|||||||
View view, int startDelay, Animator.AnimatorListener listener) {
|
View view, int startDelay, Animator.AnimatorListener listener) {
|
||||||
AnimatorSet animation = new AnimatorSet();
|
AnimatorSet animation = new AnimatorSet();
|
||||||
animation.playTogether(
|
animation.playTogether(
|
||||||
ObjectAnimator.ofFloat(view, View.ALPHA, 1, 0).setDuration(200));
|
ObjectAnimator.ofFloat(view, View.ALPHA, 1, 0).setDuration(100));
|
||||||
animation.setStartDelay(startDelay);
|
animation.setStartDelay(startDelay);
|
||||||
animation.addListener(listener);
|
animation.addListener(listener);
|
||||||
return animation;
|
return animation;
|
||||||
|
|||||||
Reference in New Issue
Block a user