Loading quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/BackgroundAppState.java +10 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS; import android.os.RemoteException; import com.android.launcher3.Launcher; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.config.FeatureFlags; import com.android.quickstep.RecentsModel; import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.views.RecentsView; Loading Loading @@ -72,4 +73,13 @@ public class BackgroundAppState extends OverviewState { float scale = (float) appWidth / sTempRect.width(); return new float[] { scale, 0f }; } @Override public int getVisibleElements(Launcher launcher) { if (FeatureFlags.SWIPE_HOME.get()) { return super.getVisibleElements(launcher); } // Hide shelf content (e.g. QSB) because we fade it in when swiping up. return ALL_APPS_HEADER_EXTRA; } } quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +27 −9 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_DAMPING_RATIO; import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_STIFFNESS; import static com.android.launcher3.anim.Interpolators.DEACCEL_3; import static com.android.launcher3.anim.Interpolators.LINEAR; import android.animation.Animator; Loading @@ -38,13 +39,20 @@ import android.view.MotionEvent; import android.view.View; import android.view.animation.Interpolator; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherInitListener; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherStateManager; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.SpringObjectAnimator; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.config.FeatureFlags; Loading @@ -61,10 +69,6 @@ import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.function.BiPredicate; import java.util.function.Consumer; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; /** * {@link ActivityControlHelper} for the in-launcher recents. */ Loading Loading @@ -212,7 +216,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe : mShelfState == ShelfAnimState.PEEK ? shelfPeekingProgress : shelfOverviewProgress; mShelfAnim = createShelfAnim(activity, toProgress); mShelfAnim = createShelfProgressAnim(activity, toProgress); mShelfAnim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { Loading @@ -230,10 +234,10 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe LauncherState fromState, long transitionLength, Consumer<AnimatorPlaybackController> callback) { LauncherState endState = OVERVIEW; if (wasVisible && fromState != BACKGROUND_APP) { // If a translucent app was launched fom launcher, animate launcher states. DeviceProfile dp = activity.getDeviceProfile(); long accuracy = 2 * Math.max(dp.widthPx, dp.heightPx); if (wasVisible && fromState != BACKGROUND_APP) { // If a translucent app was launched fom launcher, animate launcher states. callback.accept(activity.getStateManager() .createAnimationToNewWorkspace(fromState, endState, accuracy)); return; Loading @@ -246,10 +250,11 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe if (!activity.getDeviceProfile().isVerticalBarLayout() && !FeatureFlags.SWIPE_HOME.get()) { // Don't animate the shelf when SWIPE_HOME is true, because we update it atomically. Animator shiftAnim = createShelfAnim(activity, Animator shiftAnim = createShelfProgressAnim(activity, fromState.getVerticalProgress(activity), endState.getVerticalProgress(activity)); anim.play(shiftAnim); anim.play(createShelfAlphaAnim(activity, endState, accuracy)); } playScaleDownAnim(anim, activity, endState); Loading @@ -266,7 +271,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe callback.accept(controller); } private Animator createShelfAnim(Launcher activity, float ... progressValues) { private Animator createShelfProgressAnim(Launcher activity, float ... progressValues) { Animator shiftAnim = new SpringObjectAnimator<>(activity.getAllAppsController(), "allAppsSpringFromACH", activity.getAllAppsController().getShiftRange(), SPRING_DAMPING_RATIO, SPRING_STIFFNESS, progressValues); Loading @@ -274,6 +279,19 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe return shiftAnim; } /** * Very quickly fade the alpha of shelf content. */ private Animator createShelfAlphaAnim(Launcher activity, LauncherState toState, long accuracy) { AllAppsTransitionController allAppsController = activity.getAllAppsController(); AnimatorSetBuilder animBuilder = new AnimatorSetBuilder(); animBuilder.setInterpolator(AnimatorSetBuilder.ANIM_ALL_APPS_FADE, DEACCEL_3); LauncherStateManager.AnimationConfig config = new LauncherStateManager.AnimationConfig(); config.duration = accuracy; allAppsController.setAlphas(toState.getVisibleElements(activity), config, animBuilder); return animBuilder.build(); } /** * Scale down recents from the center task being full screen to being in overview. */ Loading src/com/android/launcher3/allapps/AllAppsTransitionController.java +4 −1 Original line number Diff line number Diff line Loading @@ -188,9 +188,12 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil private void setAlphas(LauncherState toState, AnimationConfig config, AnimatorSetBuilder builder) { setAlphas(toState.getVisibleElements(mLauncher), config, builder); } public void setAlphas(int visibleElements, AnimationConfig config, AnimatorSetBuilder builder) { PropertySetter setter = config == null ? NO_ANIM_PROPERTY_SETTER : config.getPropertySetter(builder); int visibleElements = toState.getVisibleElements(mLauncher); boolean hasHeaderExtra = (visibleElements & ALL_APPS_HEADER_EXTRA) != 0; boolean hasContent = (visibleElements & ALL_APPS_CONTENT) != 0; Loading Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/BackgroundAppState.java +10 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS; import android.os.RemoteException; import com.android.launcher3.Launcher; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.config.FeatureFlags; import com.android.quickstep.RecentsModel; import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.views.RecentsView; Loading Loading @@ -72,4 +73,13 @@ public class BackgroundAppState extends OverviewState { float scale = (float) appWidth / sTempRect.width(); return new float[] { scale, 0f }; } @Override public int getVisibleElements(Launcher launcher) { if (FeatureFlags.SWIPE_HOME.get()) { return super.getVisibleElements(launcher); } // Hide shelf content (e.g. QSB) because we fade it in when swiping up. return ALL_APPS_HEADER_EXTRA; } }
quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +27 −9 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_DAMPING_RATIO; import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_STIFFNESS; import static com.android.launcher3.anim.Interpolators.DEACCEL_3; import static com.android.launcher3.anim.Interpolators.LINEAR; import android.animation.Animator; Loading @@ -38,13 +39,20 @@ import android.view.MotionEvent; import android.view.View; import android.view.animation.Interpolator; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherInitListener; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherStateManager; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.SpringObjectAnimator; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.config.FeatureFlags; Loading @@ -61,10 +69,6 @@ import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.function.BiPredicate; import java.util.function.Consumer; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; /** * {@link ActivityControlHelper} for the in-launcher recents. */ Loading Loading @@ -212,7 +216,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe : mShelfState == ShelfAnimState.PEEK ? shelfPeekingProgress : shelfOverviewProgress; mShelfAnim = createShelfAnim(activity, toProgress); mShelfAnim = createShelfProgressAnim(activity, toProgress); mShelfAnim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { Loading @@ -230,10 +234,10 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe LauncherState fromState, long transitionLength, Consumer<AnimatorPlaybackController> callback) { LauncherState endState = OVERVIEW; if (wasVisible && fromState != BACKGROUND_APP) { // If a translucent app was launched fom launcher, animate launcher states. DeviceProfile dp = activity.getDeviceProfile(); long accuracy = 2 * Math.max(dp.widthPx, dp.heightPx); if (wasVisible && fromState != BACKGROUND_APP) { // If a translucent app was launched fom launcher, animate launcher states. callback.accept(activity.getStateManager() .createAnimationToNewWorkspace(fromState, endState, accuracy)); return; Loading @@ -246,10 +250,11 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe if (!activity.getDeviceProfile().isVerticalBarLayout() && !FeatureFlags.SWIPE_HOME.get()) { // Don't animate the shelf when SWIPE_HOME is true, because we update it atomically. Animator shiftAnim = createShelfAnim(activity, Animator shiftAnim = createShelfProgressAnim(activity, fromState.getVerticalProgress(activity), endState.getVerticalProgress(activity)); anim.play(shiftAnim); anim.play(createShelfAlphaAnim(activity, endState, accuracy)); } playScaleDownAnim(anim, activity, endState); Loading @@ -266,7 +271,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe callback.accept(controller); } private Animator createShelfAnim(Launcher activity, float ... progressValues) { private Animator createShelfProgressAnim(Launcher activity, float ... progressValues) { Animator shiftAnim = new SpringObjectAnimator<>(activity.getAllAppsController(), "allAppsSpringFromACH", activity.getAllAppsController().getShiftRange(), SPRING_DAMPING_RATIO, SPRING_STIFFNESS, progressValues); Loading @@ -274,6 +279,19 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe return shiftAnim; } /** * Very quickly fade the alpha of shelf content. */ private Animator createShelfAlphaAnim(Launcher activity, LauncherState toState, long accuracy) { AllAppsTransitionController allAppsController = activity.getAllAppsController(); AnimatorSetBuilder animBuilder = new AnimatorSetBuilder(); animBuilder.setInterpolator(AnimatorSetBuilder.ANIM_ALL_APPS_FADE, DEACCEL_3); LauncherStateManager.AnimationConfig config = new LauncherStateManager.AnimationConfig(); config.duration = accuracy; allAppsController.setAlphas(toState.getVisibleElements(activity), config, animBuilder); return animBuilder.build(); } /** * Scale down recents from the center task being full screen to being in overview. */ Loading
src/com/android/launcher3/allapps/AllAppsTransitionController.java +4 −1 Original line number Diff line number Diff line Loading @@ -188,9 +188,12 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil private void setAlphas(LauncherState toState, AnimationConfig config, AnimatorSetBuilder builder) { setAlphas(toState.getVisibleElements(mLauncher), config, builder); } public void setAlphas(int visibleElements, AnimationConfig config, AnimatorSetBuilder builder) { PropertySetter setter = config == null ? NO_ANIM_PROPERTY_SETTER : config.getPropertySetter(builder); int visibleElements = toState.getVisibleElements(mLauncher); boolean hasHeaderExtra = (visibleElements & ALL_APPS_HEADER_EXTRA) != 0; boolean hasContent = (visibleElements & ALL_APPS_CONTENT) != 0; Loading