Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c76f61d authored by Abodunrinwa Toki's avatar Abodunrinwa Toki Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: Reduce delay of floating toolbar appearance." into mnc-dr-dev

parents 0c15693e a6200068
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import java.util.Arrays;
public class FloatingActionMode extends ActionMode {

    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 ActionMode.Callback2 mCallback;
@@ -181,7 +181,6 @@ public class FloatingActionMode extends ActionMode {
                // Content rect is moving.
                mOriginatingView.removeCallbacks(mMovingOff);
                mFloatingToolbarVisibilityHelper.setMoving(true);
                mFloatingToolbarVisibilityHelper.updateToolbarVisibility();
                mOriginatingView.postDelayed(mMovingOff, MOVING_HIDE_DELAY);

                mFloatingToolbar.setContentRect(mContentRectOnScreen);
@@ -189,9 +188,9 @@ public class FloatingActionMode extends ActionMode {
            }
        } else {
            mFloatingToolbarVisibilityHelper.setOutOfBounds(true);
            mFloatingToolbarVisibilityHelper.updateToolbarVisibility();
            mContentRectOnScreen.setEmpty();
        }
        mFloatingToolbarVisibilityHelper.updateToolbarVisibility();

        mPreviousContentRectOnScreen.set(mContentRectOnScreen);
    }
+2 −3
Original line number Diff line number Diff line
@@ -1488,10 +1488,9 @@ public final class FloatingToolbar {
    private static AnimatorSet createEnterAnimation(View view) {
        AnimatorSet animation =  new AnimatorSet();
        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.
                ObjectAnimator.ofFloat(view, View.X, view.getX(), view.getX()));
        animation.setStartDelay(50);
        return animation;
    }

@@ -1506,7 +1505,7 @@ public final class FloatingToolbar {
            View view, int startDelay, Animator.AnimatorListener listener) {
        AnimatorSet animation =  new AnimatorSet();
        animation.playTogether(
                ObjectAnimator.ofFloat(view, View.ALPHA, 1, 0).setDuration(200));
                ObjectAnimator.ofFloat(view, View.ALPHA, 1, 0).setDuration(100));
        animation.setStartDelay(startDelay);
        animation.addListener(listener);
        return animation;