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

Commit 0e57817a authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Merging ub-launcher3-qt-dev, build 5656472

Test: Manual
Bug:125844074 P2 Final UX and animations for Launcher DWB integration
Bug:129985827 P1 [Fully Gestural Navigation] Delay Recents animation when swiping up
Bug:131360075 P1 [Gesture Nav] Polish/finish landscape
Bug:132900132 P1 Apparently, tests start running while provisioning is still in progress
Bug:133009122 P2 Rare flake: dragged launchable to workspace, but the current state is not WORKSPACE; Can't find a launcher object; selector: BySelector [RES='\Qcom.google.android.apps.nexuslauncher:id/apps_view\E']
Bug:133443741 P2 Provide a ImageApi.cropBitmap API between Launcher/UI library
Bug:133765434 P1 [Flaky test] Launching task didn't open a new window
Bug:133867119 P2 Lab-only flake: want to switch from workspace to all apps; Swipe failed to receive an event for the swipe end
Bug:134091263 P1 Can't swipe up
Bug:134164918 P1 STOPSHIP: Disable chips hard-coded value in qt_dev Launcher
Bug:134309036 P1 Immediately dragging up after opening recents causes a flicker with fully gestural navigation enabled
Bug:134309189 P1 Immediately dragging up from recents doesn't open all apps with fully gestural navigation enabled
Bug:134406364 P2 [Multiuser] Pixel launcher crashed after switching to secondary user.
Bug:134559760 P2 Launcher crashed when keeping phone in face enroll page for 2~3 minutes. (fail rate: 3 of 10 trials)
Bug:134707989 P1 List widgets are reinitialized on rotation
Bug:134725160 P2 Swiping up on two-button nav does not hide icons with 3p launcher
Bug:134919468 P2 [Q-Preview4] Quickstep crash on app remaining time tap on Essential phone
Bug:134963243 P4 In multiwindow mode, seeing a shade on scrolling all apps screen.
Bug:134964922 P1 Wrap createLegacyIconExtras in a target sdk check
Bug:134969824 P4 Pixel launcher crashed while resuming chrome video in PIP mode
Bug:134971634 P1 onSystemUiStateChanged and some other binder calls can crash Launcher
Bug:135008910 P1 Launcher with black status bar/nav bar icons
Bug:135038270 P1 Apps getting stuck while switching in the overiew screen.
Bug:135050372 P1 Regression: Can no longer double swipe nav bar from an app to go to all apps in 2-button mode
Bug:135114549 P1 TaskView becomes visible at the end to swipe-down
Bug:issue priority summary

Change-Id: Ief4ecb36f17e168cdeb7aef930bcb051e29dbc02
parents 0ea61abe 3d6e96d5
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -61,4 +61,9 @@ public abstract class GoActivityControlHelper<T extends BaseDraggingActivity> im
        // Go does not support live tiles.
        // Go does not support live tiles.
        return false;
        return false;
    }
    }

    @Override
    public void onLaunchTaskFailed(T activity) {
        // Go does not support gestures from one task to another.
    }
}
}
+4 −2
Original line number Original line Diff line number Diff line
@@ -64,10 +64,12 @@ public class BackgroundAppState extends OverviewState {
    public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) {
    public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) {
        // Initialize the recents view scale to what it would be when starting swipe up
        // Initialize the recents view scale to what it would be when starting swipe up
        RecentsView recentsView = launcher.getOverviewPanel();
        RecentsView recentsView = launcher.getOverviewPanel();
        if (recentsView.getTaskViewCount() == 0) {
        int taskCount = recentsView.getTaskViewCount();
        if (taskCount == 0) {
            return super.getOverviewScaleAndTranslation(launcher);
            return super.getOverviewScaleAndTranslation(launcher);
        }
        }
        TaskView dummyTask = recentsView.getTaskViewAt(recentsView.getCurrentPage());
        TaskView dummyTask = recentsView.getTaskViewAt(Math.max(taskCount - 1,
                recentsView.getCurrentPage()));
        return recentsView.getTempClipAnimationHelper().updateForFullscreenOverview(dummyTask)
        return recentsView.getTempClipAnimationHelper().updateForFullscreenOverview(dummyTask)
                .getScaleAndTranslation();
                .getScaleAndTranslation();
    }
    }
+11 −1
Original line number Original line Diff line number Diff line
@@ -15,6 +15,9 @@
 */
 */
package com.android.launcher3.uioverrides.states;
package com.android.launcher3.uioverrides.states;


import android.os.Handler;
import android.os.Looper;

import com.android.launcher3.Launcher;
import com.android.launcher3.Launcher;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.RecentsView;
@@ -27,6 +30,8 @@ import com.android.quickstep.views.TaskView;
 */
 */
public class QuickSwitchState extends BackgroundAppState {
public class QuickSwitchState extends BackgroundAppState {


    private static final String TAG = "QuickSwitchState";

    public QuickSwitchState(int id) {
    public QuickSwitchState(int id) {
        super(id, LauncherLogProto.ContainerType.APP);
        super(id, LauncherLogProto.ContainerType.APP);
    }
    }
@@ -48,7 +53,12 @@ public class QuickSwitchState extends BackgroundAppState {
    public void onStateTransitionEnd(Launcher launcher) {
    public void onStateTransitionEnd(Launcher launcher) {
        TaskView tasktolaunch = launcher.<RecentsView>getOverviewPanel().getTaskViewAt(0);
        TaskView tasktolaunch = launcher.<RecentsView>getOverviewPanel().getTaskViewAt(0);
        if (tasktolaunch != null) {
        if (tasktolaunch != null) {
            tasktolaunch.launchTask(false);
            tasktolaunch.launchTask(false, success -> {
                if (!success) {
                    launcher.getStateManager().goToState(OVERVIEW);
                    tasktolaunch.notifyTaskLaunchFailed(TAG);
                }
            }, new Handler(Looper.getMainLooper()));
        } else {
        } else {
            launcher.getStateManager().goToState(NORMAL);
            launcher.getStateManager().goToState(NORMAL);
        }
        }
+6 −0
Original line number Original line Diff line number Diff line
@@ -224,4 +224,10 @@ public final class FallbackActivityControllerHelper implements
    public boolean isInLiveTileMode() {
    public boolean isInLiveTileMode() {
        return false;
        return false;
    }
    }

    @Override
    public void onLaunchTaskFailed(RecentsActivity activity) {
        // TODO: probably go back to overview instead.
        activity.<RecentsView>getOverviewPanel().startHome();
    }
}
}
+83 −20
Original line number Original line Diff line number Diff line
@@ -16,13 +16,17 @@
package com.android.quickstep;
package com.android.quickstep;


import static android.view.View.TRANSLATION_Y;
import static android.view.View.TRANSLATION_Y;

import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherStateManager.ANIM_ALL;
import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_DAMPING_RATIO;
import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_DAMPING_RATIO;
import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_STIFFNESS;
import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_STIFFNESS;
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.INSTANT;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.quickstep.WindowTransformSwipeHandler.RECENTS_ATTACH_DURATION;
import static com.android.quickstep.WindowTransformSwipeHandler.RECENTS_ATTACH_DURATION;


@@ -44,16 +48,19 @@ import android.view.animation.Interpolator;
import androidx.annotation.NonNull;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.annotation.UiThread;
import androidx.dynamicanimation.animation.SpringAnimation;
import androidx.dynamicanimation.animation.SpringForce;


import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherInitListenerEx;
import com.android.launcher3.LauncherInitListenerEx;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager;
import com.android.launcher3.allapps.DiscoveryBounce;
import com.android.launcher3.allapps.DiscoveryBounce;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.anim.SpringObjectAnimator;
import com.android.launcher3.anim.SpringObjectAnimator;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.views.FloatingIconView;
import com.android.launcher3.views.FloatingIconView;
@@ -99,6 +106,13 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
        DiscoveryBounce.showForOverviewIfNeeded(activity);
        DiscoveryBounce.showForOverviewIfNeeded(activity);
    }
    }


    @Override
    public void onSwipeUpToHomeComplete(Launcher activity) {
        // Ensure recents is at the correct position for NORMAL state. For example, when we detach
        // recents, we assume the first task is invisible, making translation off by one task.
        activity.getStateManager().reapplyState();
    }

    @Override
    @Override
    public void onAssistantVisibilityChanged(float visibility) {
    public void onAssistantVisibilityChanged(float visibility) {
        Launcher launcher = getCreatedActivity();
        Launcher launcher = getCreatedActivity();
@@ -156,18 +170,23 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
            public AnimatorPlaybackController createActivityAnimationToHome() {
            public AnimatorPlaybackController createActivityAnimationToHome() {
                // Return an empty APC here since we have an non-user controlled animation to home.
                // Return an empty APC here since we have an non-user controlled animation to home.
                long accuracy = 2 * Math.max(dp.widthPx, dp.heightPx);
                long accuracy = 2 * Math.max(dp.widthPx, dp.heightPx);
                AnimatorSet as = new AnimatorSet();
                return activity.getStateManager().createAnimationToNewWorkspace(NORMAL, accuracy,
                as.addListener(new AnimatorListenerAdapter() {
                        0 /* animComponents */);
                    @Override
                    public void onAnimationStart(Animator animation) {
                        activity.getStateManager().goToState(NORMAL, false);
                    }
                });
                return AnimatorPlaybackController.wrap(as, accuracy);
            }
            }


            @Override
            @Override
            public void playAtomicAnimation(float velocity) {
            public void playAtomicAnimation(float velocity) {
                // Setup workspace with 0 duration to prepare for our staggered animation.
                LauncherStateManager stateManager = activity.getStateManager();
                AnimatorSetBuilder builder = new AnimatorSetBuilder();
                // setRecentsAttachedToAppWindow() will animate recents out.
                builder.addFlag(AnimatorSetBuilder.FLAG_DONT_ANIMATE_OVERVIEW);
                stateManager.createAtomicAnimation(BACKGROUND_APP, NORMAL, builder, ANIM_ALL, 0);
                builder.build().start();

                // Stop scrolling so that it doesn't interfere with the translation offscreen.
                recentsView.getScroller().forceFinished(true);

                new StaggeredWorkspaceAnim(activity, workspaceView, velocity).start();
                new StaggeredWorkspaceAnim(activity, workspaceView, velocity).start();
            }
            }
        };
        };
@@ -196,12 +215,11 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
        // Optimization, hide the all apps view to prevent layout while initializing
        // Optimization, hide the all apps view to prevent layout while initializing
        activity.getAppsView().getContentView().setVisibility(View.GONE);
        activity.getAppsView().getContentView().setVisibility(View.GONE);


        AccessibilityManagerCompat.sendStateEventToTest(activity, fromState.ordinal);

        return new AnimationFactory() {
        return new AnimationFactory() {
            private Animator mShelfAnim;
            private Animator mShelfAnim;
            private ShelfAnimState mShelfState;
            private ShelfAnimState mShelfState;
            private Animator mAttachToWindowAnim;
            private Animator mAttachToWindowFadeAnim;
            private SpringAnimation mAttachToWindowTranslationXAnim;
            private boolean mIsAttachedToWindow;
            private boolean mIsAttachedToWindow;


            @Override
            @Override
@@ -267,20 +285,60 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
                    return;
                    return;
                }
                }
                mIsAttachedToWindow = attached;
                mIsAttachedToWindow = attached;
                if (mAttachToWindowAnim != null) {
                if (mAttachToWindowFadeAnim != null) {
                    mAttachToWindowAnim.cancel();
                    mAttachToWindowFadeAnim.cancel();
                }
                }
                mAttachToWindowAnim = ObjectAnimator.ofFloat(activity.getOverviewPanel(),
                RecentsView recentsView = activity.getOverviewPanel();
                mAttachToWindowFadeAnim = ObjectAnimator.ofFloat(recentsView,
                        RecentsView.CONTENT_ALPHA, attached ? 1 : 0);
                        RecentsView.CONTENT_ALPHA, attached ? 1 : 0);
                mAttachToWindowAnim.addListener(new AnimatorListenerAdapter() {

                int runningTaskIndex = recentsView.getRunningTaskIndex();
                if (runningTaskIndex == 0) {
                    // If we are on the first task (we haven't quick switched), translate recents in
                    // from the side. Calculate the start translation based on current scale/scroll.
                    float currScale = recentsView.getScaleX();
                    float scrollOffsetX = recentsView.getScrollOffset();

                    float offscreenX = NORMAL.getOverviewScaleAndTranslation(activity).translationX;
                    // The first task is hidden, so offset by its width.
                    int firstTaskWidth = recentsView.getTaskViewAt(0).getWidth();
                    offscreenX -= (firstTaskWidth + recentsView.getPageSpacing()) * currScale;
                    // Offset since scale pushes tasks outwards.
                    offscreenX += firstTaskWidth * (currScale - 1) / 2;
                    offscreenX = Math.max(0, offscreenX);
                    if (recentsView.isRtl()) {
                        offscreenX = -offscreenX;
                    }

                    float fromTranslationX = attached ? offscreenX - scrollOffsetX : 0;
                    float toTranslationX = attached ? 0 : offscreenX - scrollOffsetX;
                    if (mAttachToWindowTranslationXAnim == null) {
                        mAttachToWindowTranslationXAnim = new SpringAnimation(recentsView,
                                SpringAnimation.TRANSLATION_X).setSpring(new SpringForce()
                                .setDampingRatio(0.8f)
                                .setStiffness(250));
                    }
                    if (!recentsView.isShown() && animate) {
                        recentsView.setTranslationX(fromTranslationX);
                        mAttachToWindowTranslationXAnim.setStartValue(fromTranslationX);
                    }
                    mAttachToWindowTranslationXAnim.animateToFinalPosition(toTranslationX);
                    if (!animate && mAttachToWindowTranslationXAnim.canSkipToEnd()) {
                        mAttachToWindowTranslationXAnim.skipToEnd();
                    }

                    mAttachToWindowFadeAnim.setInterpolator(attached ? INSTANT : ACCEL_2);
                } else {
                    mAttachToWindowFadeAnim.setInterpolator(ACCEL_DEACCEL);
                }
                mAttachToWindowFadeAnim.addListener(new AnimatorListenerAdapter() {
                    @Override
                    @Override
                    public void onAnimationEnd(Animator animation) {
                    public void onAnimationEnd(Animator animation) {
                        mAttachToWindowAnim = null;
                        mAttachToWindowFadeAnim = null;
                    }
                    }
                });
                });
                mAttachToWindowAnim.setInterpolator(ACCEL_DEACCEL);
                mAttachToWindowFadeAnim.setDuration(animate ? RECENTS_ATTACH_DURATION : 0);
                mAttachToWindowAnim.setDuration(animate ? RECENTS_ATTACH_DURATION : 0);
                mAttachToWindowFadeAnim.start();
                mAttachToWindowAnim.start();
            }
            }
        };
        };
    }
    }
@@ -448,4 +506,9 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
        return launcher != null && launcher.getStateManager().getState() == OVERVIEW &&
        return launcher != null && launcher.getStateManager().getState() == OVERVIEW &&
                launcher.isStarted();
                launcher.isStarted();
    }
    }

    @Override
    public void onLaunchTaskFailed(Launcher launcher) {
        launcher.getStateManager().goToState(OVERVIEW);
    }
}
}
 No newline at end of file
Loading