mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-05 10:26:52 +00:00
Fix 2 bugs involving split staging task translation
This patch fixes two bugs related to the way tiles slide in when a split is staged. Previously, translations were not being completely reset, so on repeated splits, the thumbnails would retain their old translation setting and cause awkward movements to occur during the slide-in animation. Fixed by adding setTaskViewsPrimarySplitTranslation() and setTaskViewsSecondarySplitTranslation() in resetFromSplitSelectionState(). Fixes: 249154347 Fixes: 249824716 Test: Manual on grid and non-grid Overview, in a variety of conditions Change-Id: I2d9aa621a17f178ff8216740d76429d2ac484b39
This commit is contained in:
@@ -130,10 +130,11 @@ public final class RecentsViewStateController extends
|
||||
|
||||
mRecentsView.createSplitSelectInitAnimation(builder,
|
||||
toState.getTransitionDuration(mLauncher, true /* isToState */));
|
||||
// Add properties to shift remaining taskViews to get out of placeholder view
|
||||
// Shift tasks vertically downward to get out of placeholder view
|
||||
builder.setFloat(mRecentsView, taskViewsFloat.first,
|
||||
toState.getSplitSelectTranslation(mLauncher),
|
||||
timings.getGridSlidePrimaryInterpolator());
|
||||
// Zero out horizontal translation
|
||||
builder.setFloat(mRecentsView, taskViewsFloat.second,
|
||||
0,
|
||||
timings.getGridSlideSecondaryInterpolator());
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
package com.android.quickstep.util;
|
||||
|
||||
import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
|
||||
import static com.android.launcher3.anim.Interpolators.INSTANT;
|
||||
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
/**
|
||||
@@ -44,14 +47,14 @@ abstract class OverviewToSplitTimings implements SplitAnimationTimings {
|
||||
public int getInstructionsTextFadeInEnd() { return 300; }
|
||||
public int getInstructionsUnfoldStart() { return 167; }
|
||||
public int getInstructionsUnfoldEnd() { return 500; }
|
||||
public Interpolator getGridSlidePrimaryInterpolator() { return EMPHASIZED; }
|
||||
public Interpolator getGridSlideSecondaryInterpolator() { return INSTANT; }
|
||||
|
||||
abstract public int getDuration();
|
||||
abstract public Interpolator getStagedRectXInterpolator();
|
||||
abstract public Interpolator getStagedRectYInterpolator();
|
||||
abstract public Interpolator getStagedRectScaleXInterpolator();
|
||||
abstract public Interpolator getStagedRectScaleYInterpolator();
|
||||
abstract public Interpolator getGridSlidePrimaryInterpolator();
|
||||
abstract public Interpolator getGridSlideSecondaryInterpolator();
|
||||
|
||||
public float getGridSlideStartOffset() {
|
||||
return (float) getGridSlideStart() / getDuration();
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.quickstep.util;
|
||||
|
||||
import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
|
||||
import static com.android.launcher3.anim.Interpolators.INSTANT;
|
||||
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
@@ -41,6 +40,4 @@ public class PhoneOverviewToSplitTimings
|
||||
public Interpolator getStagedRectYInterpolator() { return EMPHASIZED; }
|
||||
public Interpolator getStagedRectScaleXInterpolator() { return EMPHASIZED; }
|
||||
public Interpolator getStagedRectScaleYInterpolator() { return EMPHASIZED; }
|
||||
public Interpolator getGridSlidePrimaryInterpolator() { return EMPHASIZED; }
|
||||
public Interpolator getGridSlideSecondaryInterpolator() { return INSTANT; }
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.quickstep.util;
|
||||
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
@@ -41,6 +40,4 @@ public class TabletOverviewToSplitTimings
|
||||
public Interpolator getStagedRectYInterpolator() { return DEACCEL_2; }
|
||||
public Interpolator getStagedRectScaleXInterpolator() { return DEACCEL_2; }
|
||||
public Interpolator getStagedRectScaleYInterpolator() { return DEACCEL_2; }
|
||||
public Interpolator getGridSlidePrimaryInterpolator() { return LINEAR; }
|
||||
public Interpolator getGridSlideSecondaryInterpolator() { return LINEAR; }
|
||||
}
|
||||
|
||||
@@ -3115,6 +3115,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
+ splitTimings.getGridSlideDurationOffset(), 0f, 1f)
|
||||
: 1f;
|
||||
|
||||
// Slide tiles in horizontally to fill dismissed area
|
||||
anim.setFloat(child, translationProperty, scrollDiff,
|
||||
clampToProgress(
|
||||
splitTimings.getGridSlidePrimaryInterpolator(),
|
||||
@@ -4286,6 +4287,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
snapToPageImmediately(pageToSnapTo);
|
||||
}
|
||||
onLayout(false /* changed */, getLeft(), getTop(), getRight(), getBottom());
|
||||
|
||||
// We are leaving split selection state, so it is safe to reset thumbnail translations for
|
||||
// the next time split is invoked.
|
||||
setTaskViewsPrimarySplitTranslation(0);
|
||||
setTaskViewsSecondarySplitTranslation(0);
|
||||
|
||||
resetTaskVisuals();
|
||||
mSplitHiddenTaskViewIndex = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user