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

Commit 662f12fe authored by Jon Miranda's avatar Jon Miranda Committed by Jonathan Miranda
Browse files

Merging ub-launcher3-qt-dev, build 5565340

Test: Manual

Bug:118266305 Weird behavior of choosing external display task from Recents
Bug:122843905 Polish app opening transition
Bug:123900446 App to home animation should zoom into the app icon
Bug:124239413 Tests failed, caused by "One thread to rule them all"
Bug:124414511 Notification dots location should respect the icon shape when Theme is applied
Bug:124510042 [Gesture Nav] Home animation polish
Bug:128376812 Switching apps is very buggy
Bug:128986173 Not sure why the text for the at a glance widget is in Roboto instead of Google Sans.
Bug:129421797 Change client ids from GEL and OVERVIEW_GEL to home and overview
Bug:129985827 [Fully Gestural Navigation] Delay Recents animation when swiping up
Bug:130020567 Handle fullscreen correctly for quick switch
Bug:130303405 Use Adrian's haptic value for assist gesture
Bug:130451254 QSB/Folder icon color depends on three variants of wallpaper shade on light/dark theme
Bug:130558787 [Tests broken/flaky] home button not visible to accessibility in 2-button mode
Bug:130828539 [Gestural Nav] Screen pinning option is not available in fully gestural navigation mode.
Bug:131116593 Enable BindWidgetTest, RequestPinItemTest
Bug:131188880 [Failing test] AppPredictionsUITests.testPredictionExistsInAllApps
Bug:131315856 Restore of launcher for work profile failed.
Bug:131360075 [Gesture Nav] Polish/finish landscape
Bug:131360249 Status bar font color inversion delayed
Bug:131419978 [Massive test failure] Switching to 3-button mode results in 2-button mode (at least on Crosshatch)
Bug:131630813 FallbackRecentsTest failing in 0-button mode
Bug:131772711 [Failing test] AppPredictionsUITests.testPredictionsDisabled
Bug:131840601 Ensure Go launcher uses the same logging points for common actions
Bug:131847153 [Feedback] Swiping from thr corners from locked phone does not put phone in listening mode (shoul...
Bug:131853975 Recents Go: Fallback recents not consuming insets correctly
Bug:131940434 Add text input character count when app launch happens from search result container
Bug:132107664 Multiple different failures when running StartLauncherViaGestureTests on Pixe1 devices
Bug:132112131 Polish app to overview animation to match UI mocks for Recents Go
Bug:132173901 0-button: swipe-up from killed Launcher not recognized
Bug:132177321 TaplTestsLauncher3.testDragAppIcon flakes even in flight mode
Bug:132269601 Allow fling assistant invocation
Bug:132285006 ContentFillItemAnimator endAnimations() does not work properly
Bug:132293341 Recents Go: Fallback recents does not always update tasks on going to recents from app
Bug:132381412 Empty views show up briefly with new app to recents anim
Bug:132449252 Recents Go: Add animation from home target to recents for fallback recents
Bug:132458790 Launcher build is broken due to AppTarget.Builder not available
Bug:132461256 Non-transparent nav bar looks bad on Recents Go b/c of lack of margins
Bug:64712476 Import translations for dev branches
Bug:80529128 Home screen went to landscape, even though settings disallows it

Change-Id: I2ffa2c41ff3ded55e1aab66d735da481112684e3
parents 35885b3c cf3584fd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ android_library {
    srcs: [
        "tests/tapl/**/*.java",
        "src/com/android/launcher3/util/SecureSettingsObserver.java",
        "src/com/android/launcher3/ResourceUtils.java",
        "src/com/android/launcher3/TestProtocol.java",
    ],
    manifest: "tests/tapl/AndroidManifest.xml",
+4 −4
Original line number Diff line number Diff line
@@ -18,13 +18,13 @@
    <dimen name="recents_list_width">480dp</dimen>

    <dimen name="task_item_height">90dp</dimen>
    <dimen name="task_item_top_margin">16dp</dimen>
    <dimen name="task_thumbnail_icon_horiz_margin">20dp</dimen>
    <dimen name="task_item_top_margin">24dp</dimen>
    <dimen name="task_thumbnail_icon_horiz_margin">24dp</dimen>

    <dimen name="task_thumbnail_corner_radius">4dp</dimen>

    <dimen name="clear_all_item_view_height">48dp</dimen>
    <dimen name="clear_all_item_view_height">52dp</dimen>
    <dimen name="clear_all_item_view_top_margin">28dp</dimen>
    <dimen name="clear_all_item_view_bottom_margin">28dp</dimen>
    <dimen name="clear_all_button_width">140dp</dimen>
    <dimen name="clear_all_button_width">160dp</dimen>
</resources>
 No newline at end of file
+41 −1
Original line number Diff line number Diff line
package com.android.launcher3;

import static com.android.launcher3.Utilities.postAsyncCallback;
import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.quickstep.TaskUtils.taskIsATargetWithMode;
import static com.android.quickstep.views.IconRecentsView.CONTENT_ALPHA;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING;

import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.ActivityOptions;
import android.content.Context;
import android.os.Handler;
import android.view.View;

import com.android.quickstep.views.IconRecentsView;
import com.android.systemui.shared.system.RemoteAnimationRunnerCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;

/**
@@ -28,6 +32,12 @@ public final class GoLauncherAppTransitionManagerImpl extends QuickstepAppTransi
        return mLauncher.getStateManager().getState().overviewUi;
    }

    @Override
    RemoteAnimationRunnerCompat getWallpaperOpenRunner(boolean fromUnlock) {
        return new GoWallpaperOpenLauncherAnimationRunner(mHandler,
                false /* startAtFrontOfQueue */, fromUnlock);
    }

    @Override
    protected void composeRecentsLaunchAnimator(AnimatorSet anim, View v,
            RemoteAnimationTargetCompat[] targets, boolean launcherClosing) {
@@ -51,4 +61,34 @@ public final class GoLauncherAppTransitionManagerImpl extends QuickstepAppTransi

        return mLauncher.getStateManager()::reapplyState;
    }

    /**
     * Remote animation runner for animation from app to Launcher. For Go, when going to recents,
     * we need to ensure that the recents view is ready for remote animation before starting.
     */
    private final class GoWallpaperOpenLauncherAnimationRunner extends
            WallpaperOpenLauncherAnimationRunner {
        public GoWallpaperOpenLauncherAnimationRunner(Handler handler, boolean startAtFrontOfQueue,
                boolean fromUnlock) {
            super(handler, startAtFrontOfQueue, fromUnlock);
        }

        @Override
        public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats,
                AnimationResult result) {
            boolean isGoingToRecents =
                    taskIsATargetWithMode(targetCompats, mLauncher.getTaskId(), MODE_OPENING)
                    && (mLauncher.getStateManager().getState() == LauncherState.OVERVIEW);
            if (isGoingToRecents) {
                IconRecentsView recentsView = mLauncher.getOverviewPanel();
                if (!recentsView.isReadyForRemoteAnim()) {
                    recentsView.setOnReadyForRemoteAnimCallback(() ->
                        postAsyncCallback(mHandler, () -> onCreateAnimation(targetCompats, result))
                    );
                    return;
                }
            }
            super.onCreateAnimation(targetCompats, result);
        }
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -21,10 +21,12 @@ import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;

import android.view.View;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherStateManager.StateHandler;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.graphics.RotationMode;
import com.android.launcher3.uioverrides.touchcontrollers.LandscapeEdgeSwipeController;
import com.android.launcher3.uioverrides.touchcontrollers.LandscapeStatesTouchController;
import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController;
@@ -102,4 +104,8 @@ public abstract class RecentsUiFactory {
     * @param launcher the launcher activity
     */
    public static void onLauncherStateOrResumeChanged(Launcher launcher) {}

    public static RotationMode getRotationMode(DeviceProfile dp) {
        return RotationMode.NORMAL;
    }
}
+64 −99
Original line number Diff line number Diff line
@@ -15,30 +15,27 @@
 */
package com.android.quickstep;

import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.Utilities.postAsyncCallback;
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
import static com.android.quickstep.util.RemoteAnimationProvider.getLayer;
import static com.android.quickstep.views.IconRecentsView.REMOTE_APP_TO_OVERVIEW_DURATION;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING;

import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.app.ActivityOptions;
import android.os.Handler;
import android.util.Log;
import android.view.View;

import androidx.annotation.NonNull;

import com.android.launcher3.BaseDraggingActivity;
import com.android.quickstep.util.MultiValueUpdateListener;
import com.android.launcher3.LauncherAnimationRunner;
import com.android.quickstep.util.RemoteAnimationProvider;
import com.android.quickstep.util.RemoteAnimationTargetSet;
import com.android.quickstep.views.IconRecentsView;
import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.RemoteAnimationAdapterCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams;

/**
 * Provider for the atomic remote window animation from the app to the overview.
@@ -47,20 +44,27 @@ import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.
 */
final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> implements
        RemoteAnimationProvider {

    private static final long APP_TO_THUMBNAIL_FADE_DURATION = 50;
    private static final long APP_SCALE_DOWN_DURATION = 400;
    private static final String TAG = "AppToOverviewAnimationProvider";

    private final ActivityControlHelper<T> mHelper;
    private final int mTargetTaskId;
    private IconRecentsView mRecentsView;
    private AppToOverviewAnimationListener mAnimationReadyListener;

    AppToOverviewAnimationProvider(ActivityControlHelper<T> helper, int targetTaskId) {
        mHelper = helper;
        mTargetTaskId = targetTaskId;
    }

    /**
     * Set listener to various points in the animation preparing to animate.
     *
     * @param listener listener
     */
    void setAnimationListener(AppToOverviewAnimationListener listener) {
        mAnimationReadyListener = listener;
    }

    /**
     * Callback for when the activity is ready/initialized.
     *
@@ -68,6 +72,9 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
     * @param wasVisible true if it was visible before
     */
    boolean onActivityReady(T activity, Boolean wasVisible) {
        if (mAnimationReadyListener != null) {
            mAnimationReadyListener.onActivityReady(activity);
        }
        ActivityControlHelper.AnimationFactory factory =
                mHelper.prepareRecentsUI(activity, wasVisible,
                        false /* animate activity */, (controller) -> {
@@ -92,6 +99,9 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
     */
    @Override
    public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] targetCompats) {
        if (mAnimationReadyListener != null) {
            mAnimationReadyListener.onWindowAnimationCreated();
        }
        AnimatorSet anim = new AnimatorSet();
        if (mRecentsView == null) {
            if (Log.isLoggable(TAG, Log.WARN)) {
@@ -131,98 +141,36 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
            return anim;
        }

        View thumbnailView = mRecentsView.getBottomThumbnailView();
        if (thumbnailView == null) {
            // This can be null if there were previously 0 tasks and the recycler view has not had
            // enough time to take in the data change, bind a new view, and lay out the new view.
            // TODO: Have a fallback to animate to
            if (Log.isLoggable(TAG, Log.WARN)) {
                Log.w(TAG, "No thumbnail view for running task. Using stub animation.");
            }
            anim.play(ValueAnimator.ofInt(0, 1).setDuration(getRecentsLaunchDuration()));
            return anim;
        if (closingAppTarget.activityType == ACTIVITY_TYPE_HOME) {
            mRecentsView.playRemoteHomeToRecentsAnimation(anim, closingAppTarget, recentsTarget);
        } else {
            mRecentsView.playRemoteAppToRecentsAnimation(anim, closingAppTarget, recentsTarget);
        }

        playAppScaleDownAnim(anim, closingAppTarget, recentsTarget, thumbnailView);

        return anim;
    }

    /**
     * Animate a closing app to scale down to the location of the thumbnail view in recents.
     *
     * @param anim animator set
     * @param appTarget the app surface thats closing
     * @param recentsTarget the surface containing recents
     * @param thumbnailView the thumbnail view to animate to
     */
    private void playAppScaleDownAnim(@NonNull AnimatorSet anim,
            @NonNull RemoteAnimationTargetCompat appTarget,
            @NonNull RemoteAnimationTargetCompat recentsTarget, @NonNull View thumbnailView) {

        // Identify where the entering remote app should animate to.
        Rect endRect = new Rect();
        thumbnailView.getGlobalVisibleRect(endRect);

        Rect appBounds = appTarget.sourceContainerBounds;

        ValueAnimator valueAnimator = ValueAnimator.ofInt(0, 1);
        valueAnimator.setDuration(APP_SCALE_DOWN_DURATION);

        SyncRtSurfaceTransactionApplierCompat surfaceApplier =
                new SyncRtSurfaceTransactionApplierCompat(thumbnailView);

        // Keep recents visible throughout the animation.
        SurfaceParams[] params = new SurfaceParams[2];
        // Closing app should stay on top.
        int boostedMode = MODE_CLOSING;
        params[0] = new SurfaceParams(recentsTarget.leash, 1f, null /* matrix */,
                null /* windowCrop */, getLayer(recentsTarget, boostedMode), 0 /* cornerRadius */);

        valueAnimator.addUpdateListener(new MultiValueUpdateListener() {
            private final FloatProp mScaleX;
            private final FloatProp mScaleY;
            private final FloatProp mTranslationX;
            private final FloatProp mTranslationY;
            private final FloatProp mAlpha;

            {
                // Scale down and move to view location.
                float endScaleX = ((float) endRect.width()) / appBounds.width();
                mScaleX = new FloatProp(1f, endScaleX, 0, APP_SCALE_DOWN_DURATION,
                        ACCEL_DEACCEL);
                float endScaleY = ((float) endRect.height()) / appBounds.height();
                mScaleY = new FloatProp(1f, endScaleY, 0, APP_SCALE_DOWN_DURATION,
                        ACCEL_DEACCEL);
                float endTranslationX = endRect.left -
                        (appBounds.width() - thumbnailView.getWidth()) / 2.0f;
                mTranslationX = new FloatProp(0, endTranslationX, 0, APP_SCALE_DOWN_DURATION,
                        ACCEL_DEACCEL);
                float endTranslationY = endRect.top -
                        (appBounds.height() - thumbnailView.getHeight()) / 2.0f;
                mTranslationY = new FloatProp(0, endTranslationY, 0, APP_SCALE_DOWN_DURATION,
                        ACCEL_DEACCEL);

                // Fade out quietly near the end to be replaced by the real view.
                mAlpha = new FloatProp(1.0f, 0,
                        APP_SCALE_DOWN_DURATION - APP_TO_THUMBNAIL_FADE_DURATION,
                        APP_TO_THUMBNAIL_FADE_DURATION, ACCEL_2);
            }

    @Override
            public void onUpdate(float percent) {
                Matrix m = new Matrix();
                m.setScale(mScaleX.value, mScaleY.value,
                        appBounds.width() / 2.0f, appBounds.height() / 2.0f);
                m.postTranslate(mTranslationX.value, mTranslationY.value);
    public ActivityOptions toActivityOptions(Handler handler, long duration) {
        LauncherAnimationRunner runner = new LauncherAnimationRunner(handler,
                false /* startAtFrontOfQueue */) {

                params[1] = new SurfaceParams(appTarget.leash, mAlpha.value, m,
                        null /* windowCrop */, getLayer(appTarget, boostedMode),
                        0 /* cornerRadius */);
                surfaceApplier.scheduleApply(params);
            @Override
            public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats,
                    AnimationResult result) {
                IconRecentsView recentsView = mRecentsView;
                if (!recentsView.isReadyForRemoteAnim()) {
                    recentsView.setOnReadyForRemoteAnimCallback(() -> postAsyncCallback(handler,
                            () -> onCreateAnimation(targetCompats, result))
                    );
                    return;
                }
        });
        anim.play(valueAnimator);
                result.setAnimation(createWindowAnimation(targetCompats));
            }
        };
        return ActivityOptionsCompat.makeRemoteAnimation(
                new RemoteAnimationAdapterCompat(runner, duration,
                        0 /* statusBarTransitionDelay */));
    }

    /**
@@ -231,6 +179,23 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
     * @return duration of animation
     */
    long getRecentsLaunchDuration() {
        return APP_SCALE_DOWN_DURATION;
        return REMOTE_APP_TO_OVERVIEW_DURATION;
    }

    /**
     * Listener for various points in the app to overview animation preparing to animate.
     */
    interface AppToOverviewAnimationListener {
        /**
         * Logic for when activity we're animating to is ready
         *
         * @param activity activity to animate to
         */
        void onActivityReady(BaseDraggingActivity activity);

        /**
         * Logic for when we've created the app to recents animation.
         */
        void onWindowAnimationCreated();
    }
}
Loading