Consider launching task's position on screen in pivot calculation
- Instead of using RecentsViewScroll, put task's position offset versus current scroll as TaskRect calculation, so it's considered when calculating for putting task to full screen
- Revert back RecentsViewScroll to apply before RecentsViewScale
- Added new property in PagedOrientationHandler to apply both primary/secondary param without clearing the other, and renamed an existing method
Fix: 206972618
Test: Quick switching
Test: Launch task from grid, launch side task from carousel overview
Change-Id: I5977975ed1e930ad70b81d83513d8f3a00c0aed4
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index cefadf7..1ce7ebe 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -252,7 +252,7 @@
if (0 <= mCurrentPage && mCurrentPage < getPageCount()) {
newPosition = getScrollForPage(mCurrentPage) + mCurrentPageScrollDiff;
}
- mOrientationHandler.set(this, VIEW_SCROLL_TO, newPosition);
+ mOrientationHandler.setPrimary(this, VIEW_SCROLL_TO, newPosition);
mScroller.startScroll(mScroller.getCurrX(), 0, newPosition - mScroller.getCurrX(), 0);
forceFinishScroller();
}
@@ -556,7 +556,7 @@
int oldPos = mOrientationHandler.getPrimaryScroll(this);
int newPos = mScroller.getCurrX();
if (oldPos != newPos) {
- mOrientationHandler.set(this, VIEW_SCROLL_TO, mScroller.getCurrX());
+ mOrientationHandler.setPrimary(this, VIEW_SCROLL_TO, mScroller.getCurrX());
}
if (mAllowOverScroll) {
@@ -1280,7 +1280,7 @@
mLastMotionRemainder = delta - movedDelta;
if (delta != 0) {
- mOrientationHandler.set(this, VIEW_SCROLL_BY, movedDelta);
+ mOrientationHandler.setPrimary(this, VIEW_SCROLL_BY, movedDelta);
if (mAllowOverScroll) {
final float pulledToX = oldScroll + delta;