mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
Cancel unfold animation when rotation changes
In DeviceFoldStateProvider.kt, FOLD_UPDATE_FINISH_HALF_OPEN is emitted if the rotation changes while the animation is in progress. This targets the case when the device goes to tabletop mode during the transition. + Using RotationChangeProvider to fix problems when the new orientation change was received in a background thread unexpectedly. This fixes: (1) wrong launcher icons movement after the rotation, and (2) wrong dark overlay scrim after rotation. + Minor formattig fixes by ktfmt Bug: 241743859 Test: DeviceFoldStateProviderTest && NaturalRotationUnfoldProgressProviderTest && manual stress testing Change-Id: Iee234e4b832cad8298b69356fce7c14d75e89ccc
This commit is contained in:
@@ -15,13 +15,13 @@
|
||||
*/
|
||||
package com.android.launcher3.taskbar;
|
||||
|
||||
import android.view.IWindowManager;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.android.quickstep.util.LauncherViewsMoveFromCenterTranslationApplier;
|
||||
import com.android.systemui.shared.animation.UnfoldMoveFromCenterAnimator;
|
||||
import com.android.systemui.unfold.UnfoldTransitionProgressProvider.TransitionProgressListener;
|
||||
import com.android.systemui.unfold.updates.RotationChangeProvider;
|
||||
import com.android.systemui.unfold.util.NaturalRotationUnfoldProgressProvider;
|
||||
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider;
|
||||
|
||||
@@ -41,16 +41,20 @@ public class TaskbarUnfoldAnimationController implements
|
||||
|
||||
public TaskbarUnfoldAnimationController(BaseTaskbarContext context,
|
||||
ScopedUnfoldTransitionProgressProvider source,
|
||||
WindowManager windowManager, IWindowManager iWindowManager) {
|
||||
WindowManager windowManager,
|
||||
RotationChangeProvider rotationChangeProvider) {
|
||||
mScopedUnfoldTransitionProgressProvider = source;
|
||||
mNaturalUnfoldTransitionProgressProvider =
|
||||
new NaturalRotationUnfoldProgressProvider(context, iWindowManager, source);
|
||||
new NaturalRotationUnfoldProgressProvider(context,
|
||||
rotationChangeProvider,
|
||||
source);
|
||||
mMoveFromCenterAnimator = new UnfoldMoveFromCenterAnimator(windowManager,
|
||||
new LauncherViewsMoveFromCenterTranslationApplier());
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the controller
|
||||
*
|
||||
* @param taskbarControllers references to all other taskbar controllers
|
||||
*/
|
||||
public void init(TaskbarControllers taskbarControllers) {
|
||||
|
||||
Reference in New Issue
Block a user