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

Commit 730ee62e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Call close for AbstractFloatingViews that were removed while still...

Merge "Call close for AbstractFloatingViews that were removed while still open." into ub-launcher3-edmonton
parents c1af02f9 83337f9e
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.launcher3;

import static com.android.launcher3.Utilities.SINGLE_FRAME_MS;
import static com.android.launcher3.Utilities.postAsyncCallback;
import static com.android.systemui.shared.recents.utilities.Utilities.postAtFrontOfQueueAsynchronously;

@@ -33,8 +34,6 @@ import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@TargetApi(Build.VERSION_CODES.P)
public abstract class LauncherAnimationRunner implements RemoteAnimationRunnerCompat {

    private static final int REFRESH_RATE_MS = 16;

    private final Handler mHandler;
    private final boolean mStartAtFrontOfQueue;
    private AnimationResult mAnimationResult;
@@ -132,7 +131,7 @@ public abstract class LauncherAnimationRunner implements RemoteAnimationRunnerCo

                // Because t=0 has the app icon in its original spot, we can skip the
                // first frame and have the same movement one frame earlier.
                mAnimator.setCurrentPlayTime(REFRESH_RATE_MS);
                mAnimator.setCurrentPlayTime(SINGLE_FRAME_MS);
            }
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.launcher3.uioverrides;

import static com.android.launcher3.Utilities.SINGLE_FRAME_MS;
import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;

import android.animation.Animator;
@@ -46,7 +47,6 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity>
    private static final String TAG = "OverviewSwipeController";

    private static final float ALLOWED_FLING_DIRECTION_CHANGE_PROGRESS = 0.1f;
    private static final int SINGLE_FRAME_MS = 16;

    // Progress after which the transition is assumed to be a success in case user does not fling
    private static final float SUCCESS_TRANSITION_PROGRESS = 0.5f;
+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
        handleClose(animate);
        BaseActivity.fromContext(getContext()).getUserEventDispatcher()
                .resetElapsedContainerMillis("container closed");
        mIsOpen = false;
    }

    protected abstract void handleClose(boolean animate);
+5 −5
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ import android.view.View;
import android.view.ViewPropertyAnimator;
import android.view.ViewTreeObserver;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.util.TraceHelper;

import static com.android.launcher3.Utilities.SINGLE_FRAME_MS;

/*
 *  This is a helper class that listens to updates from the corresponding animation.
@@ -36,7 +37,6 @@ public class FirstFrameAnimatorHelper extends AnimatorListenerAdapter
    private static final String TAG = "FirstFrameAnimatorHlpr";
    private static final boolean DEBUG = false;
    private static final int MAX_DELAY = 1000;
    private static final int IDEAL_FRAME_DURATION = 16;
    private final View mTarget;
    private long mStartFrame;
    private long mStartTime = -1;
@@ -109,9 +109,9 @@ public class FirstFrameAnimatorHelper extends AnimatorListenerAdapter
            // prevents a large jump in the animation due to an expensive first frame
            } else if (frameNum == 1 && currentTime < mStartTime + MAX_DELAY &&
                       !mAdjustedSecondFrameTime &&
                       currentTime > mStartTime + IDEAL_FRAME_DURATION &&
                       currentPlayTime > IDEAL_FRAME_DURATION) {
                animation.setCurrentPlayTime(IDEAL_FRAME_DURATION);
                       currentTime > mStartTime + SINGLE_FRAME_MS &&
                       currentPlayTime > SINGLE_FRAME_MS) {
                animation.setCurrentPlayTime(SINGLE_FRAME_MS);
                mAdjustedSecondFrameTime = true;
            } else {
                if (frameNum > 1) {
+2 −0
Original line number Diff line number Diff line
@@ -103,6 +103,8 @@ public final class Utilities {
    public static final boolean ATLEAST_LOLLIPOP_MR1 =
            Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1;

    public static final int SINGLE_FRAME_MS = 16;

    /**
     * Indicates if the device has a debug build. Should only be used to store additional info or
     * add extra logging and not for changing the app behavior.
Loading