Merge "Fixing recentsView getting translated in NavBarToHomeTouchController" into ub-launcher3-rvc-dev

This commit is contained in:
TreeHugger Robot
2020-04-22 22:42:46 +00:00
committed by Android (Google) Code Review
3 changed files with 15 additions and 11 deletions
@@ -197,14 +197,15 @@ public final class LauncherAppTransitionManagerImpl extends QuickstepAppTransiti
case INDEX_RECENTS_FADE_ANIM:
return ObjectAnimator.ofFloat(mLauncher.getOverviewPanel(),
RecentsView.CONTENT_ALPHA, values);
case INDEX_RECENTS_TRANSLATE_X_ANIM:
// TODO: Do not assume motion across X axis for adjacent page
case INDEX_RECENTS_TRANSLATE_X_ANIM: {
RecentsView rv = mLauncher.getOverviewPanel();
return new SpringAnimationBuilder(mLauncher)
.setMinimumVisibleChange(1f / mLauncher.getOverviewPanel().getWidth())
.setMinimumVisibleChange(1f / rv.getPageOffsetScale())
.setDampingRatio(0.8f)
.setStiffness(250)
.setValues(values)
.build(mLauncher.getOverviewPanel(), ADJACENT_PAGE_OFFSET);
.build(rv, ADJACENT_PAGE_OFFSET);
}
case INDEX_PAUSE_TO_OVERVIEW_ANIM: {
StateAnimationConfig config = new StateAnimationConfig();
config.duration = ATOMIC_DURATION_FROM_PAUSED_TO_OVERVIEW;
@@ -15,7 +15,6 @@
*/
package com.android.launcher3.uioverrides.touchcontrollers;
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
@@ -23,6 +22,7 @@ import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.touch.AbstractStateChangeTouchController.SUCCESS_TRANSITION_PROGRESS;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_OFFSET;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import android.animation.ValueAnimator;
@@ -131,12 +131,8 @@ public class NavBarToHomeTouchController implements TouchController,
final PendingAnimation builder = new PendingAnimation(accuracy);
if (mStartState == OVERVIEW) {
RecentsView recentsView = mLauncher.getOverviewPanel();
float pullbackDist = mPullbackDistance;
if (!recentsView.isRtl()) {
pullbackDist = -pullbackDist;
}
builder.setFloat(recentsView, VIEW_TRANSLATE_X, pullbackDist, PULLBACK_INTERPOLATOR);
builder.setFloat(recentsView, ADJACENT_PAGE_OFFSET,
-mPullbackDistance / recentsView.getPageOffsetScale(), PULLBACK_INTERPOLATOR);
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
builder.addOnFrameCallback(
() -> recentsView.redrawLiveTile(false /* mightNeedToRefill */));
@@ -1670,6 +1670,13 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
updateCurveProperties();
}
/**
* TODO: Do not assume motion across X axis for adjacent page
*/
public float getPageOffsetScale() {
return Math.max(getWidth(), 1);
}
private void updateDeadZoneRects() {
// Get the deadzone rect surrounding the clear all button to not dismiss overview to home
mClearAllButtonDeadZoneRect.setEmpty();