mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Merge "Fixing current task not overshooting on swipe-up in overview" into ub-launcher3-rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ed31f24dbf
@@ -38,7 +38,6 @@ import android.graphics.RectF;
|
||||
import android.os.Build;
|
||||
import android.util.Pair;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -131,6 +130,8 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||
protected boolean mCanceled;
|
||||
protected int mLastStartedTaskId = -1;
|
||||
|
||||
private boolean mRecentsViewScrollLinked = false;
|
||||
|
||||
protected BaseSwipeUpHandler(Context context, RecentsAnimationDeviceState deviceState,
|
||||
GestureState gestureState, InputConsumerController inputConsumer,
|
||||
WindowSizeStrategy windowSizeStrategy) {
|
||||
@@ -203,6 +204,7 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||
runOnRecentsAnimationStart(() ->
|
||||
mRecentsView.setRecentsAnimationTargets(mRecentsAnimationController,
|
||||
mRecentsAnimationTargets));
|
||||
mRecentsViewScrollLinked = true;
|
||||
}
|
||||
|
||||
protected void startNewTask(Consumer<Boolean> resultCallback) {
|
||||
@@ -329,19 +331,6 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||
: mRecentsView.getRunningTaskIndex();
|
||||
}
|
||||
|
||||
private Rect getStackBounds(DeviceProfile dp) {
|
||||
if (mActivity != null) {
|
||||
int loc[] = new int[2];
|
||||
View rootView = mActivity.getRootView();
|
||||
rootView.getLocationOnScreen(loc);
|
||||
return new Rect(loc[0], loc[1], loc[0] + rootView.getWidth(),
|
||||
loc[1] + rootView.getHeight());
|
||||
} else {
|
||||
return new Rect(dp.windowX, dp.windowY,
|
||||
dp.windowX + dp.widthPx, dp.windowY + dp.heightPx);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initTransitionEndpoints(DeviceProfile dp) {
|
||||
mDp = dp;
|
||||
|
||||
@@ -440,7 +429,9 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||
mWindowTransitionController.setPlayFraction(progress);
|
||||
mTransformParams.setTargetSet(mRecentsAnimationTargets);
|
||||
|
||||
mTaskViewSimulator.setScroll(mRecentsView == null ? 0 : mRecentsView.getScrollOffset());
|
||||
if (mRecentsViewScrollLinked) {
|
||||
mTaskViewSimulator.setScroll(mRecentsView.getScrollOffset());
|
||||
}
|
||||
mTaskViewSimulator.apply(mTransformParams);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +295,6 @@ public class LauncherSwipeHandler extends BaseSwipeUpHandler<Launcher, RecentsVi
|
||||
|
||||
mRecentsView = activity.getOverviewPanel();
|
||||
mRecentsView.setOnPageTransitionEndCallback(null);
|
||||
linkRecentsViewScroll();
|
||||
addLiveTileOverlay();
|
||||
|
||||
mStateCallback.setState(STATE_LAUNCHER_PRESENT);
|
||||
@@ -312,6 +311,8 @@ public class LauncherSwipeHandler extends BaseSwipeUpHandler<Launcher, RecentsVi
|
||||
// so we need to kick off switching to the overview predictions as soon as possible
|
||||
mActivityInterface.updateOverviewPredictionState();
|
||||
}
|
||||
linkRecentsViewScroll();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.quickstep.views;
|
||||
|
||||
import static android.view.Surface.ROTATION_0;
|
||||
|
||||
import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS;
|
||||
import static com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_ICON_PARAMS;
|
||||
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
|
||||
@@ -132,7 +133,6 @@ import com.android.systemui.shared.recents.IPinnedStackAnimationListener;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||
import com.android.systemui.shared.system.ConfigurationCompat;
|
||||
import com.android.systemui.shared.system.LauncherEventUtil;
|
||||
import com.android.systemui.shared.system.PackageManagerWrapper;
|
||||
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat;
|
||||
@@ -1689,7 +1689,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||
}
|
||||
int count = getChildCount();
|
||||
|
||||
TaskView runningTask = mRunningTaskId == -1 ? null : getTaskView(mRunningTaskId);
|
||||
TaskView runningTask = mRunningTaskId == -1 || !mRunningTaskTileHidden
|
||||
? null : getTaskView(mRunningTaskId);
|
||||
int midPoint = runningTask == null ? -1 : indexOfChild(runningTask);
|
||||
int currentPage = getCurrentPage();
|
||||
|
||||
@@ -2066,14 +2067,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||
return getScrollForPage(getRunningTaskIndex()) - mOrientationHandler.getPrimaryScroll(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return How many pixels the running task is offset on the x-axis due to the current scrollX
|
||||
* and parent scale.
|
||||
*/
|
||||
public float getScrollOffsetScaled() {
|
||||
return getScrollOffset() * mOrientationHandler.getPrimaryScale(this);
|
||||
}
|
||||
|
||||
public Consumer<MotionEvent> getEventDispatcher(float navbarRotation) {
|
||||
float degreesRotated;
|
||||
if (navbarRotation == 0) {
|
||||
|
||||
Reference in New Issue
Block a user