Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-v2-dev
diff --git a/quickstep/res/values-hy/strings.xml b/quickstep/res/values-hy/strings.xml
index e4d9991..8a5a875 100644
--- a/quickstep/res/values-hy/strings.xml
+++ b/quickstep/res/values-hy/strings.xml
@@ -46,9 +46,9 @@
<string name="hotsaet_tip_prediction_disabled" msgid="1506426298884658491">"«Առաջարկվող հավելվածներ» գործառույթն անջատված է"</string>
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"Առաջարկվող հավելված՝ <xliff:g id="TITLE">%1$s</xliff:g>"</string>
<string name="back_gesture_feedback_swipe_too_far_from_left_edge" msgid="340972404868601012">"Համոզվեք, որ մատը սահեցնում եք էկրանի ձախ եզրից։"</string>
- <string name="back_gesture_feedback_cancelled_left_edge" msgid="6671316150388702530">"Սահեցրեք մատն էկրանի ձախ եզրից դեպի կենտրոն և բաց թողեք։"</string>
+ <string name="back_gesture_feedback_cancelled_left_edge" msgid="6671316150388702530">"Մատը սահեցրեք էկրանի ձախ եզրից դեպի կենտրոն և բաց թողեք։"</string>
<string name="back_gesture_feedback_swipe_too_far_from_right_edge" msgid="4306700023773832353">"Համոզվեք, որ մատը սահեցնում եք էկրանի աջ եզրից։"</string>
- <string name="back_gesture_feedback_cancelled_right_edge" msgid="4951916546256902552">"Սահեցրեք մատն էկրանի աջ եզրից դեպի կենտրոն և բաց թողեք։"</string>
+ <string name="back_gesture_feedback_cancelled_right_edge" msgid="4951916546256902552">"Մատը սահեցրեք էկրանի աջ եզրից դեպի կենտրոն և բաց թողեք։"</string>
<string name="back_gesture_feedback_complete_with_back_right_follow_up" msgid="2100639504811809267">"Դուք սովորեցիք՝ ինչպես մատը ձախից սահեցնելով հետ գնալ"</string>
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Դուք սովորեցիք՝ ինչպես մատը աջից սահեցնելով հետ գնալ։ Այժմ սովորենք՝ ինչպես անցնել մի հավելվածից մյուսը։"</string>
<string name="back_gesture_feedback_complete_without_follow_up" msgid="6405649621667113830">"Դուք սովորեցիք հետ գնալու ժեստը։"</string>
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index eec0a71..c7924e4 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -2438,12 +2438,15 @@
resetTaskVisuals();
int pageToSnapTo = mCurrentPage;
- if (finalNextFocusedTaskView != null) {
- pageToSnapTo = indexOfChild(finalNextFocusedTaskView);
- }
- if (dismissedIndex < pageToSnapTo || pageToSnapTo == (taskCount - 1)) {
+ if ((dismissedIndex < pageToSnapTo && !showAsGrid)
+ || pageToSnapTo == taskCount - 1) {
pageToSnapTo -= 1;
}
+ if (showAsGrid) {
+ int primaryScroll = mOrientationHandler.getPrimaryScroll(RecentsView.this);
+ int currentPageScroll = getScrollForPage(pageToSnapTo);
+ mCurrentPageScrollDiff = primaryScroll - currentPageScroll;
+ }
removeViewInLayout(dismissedTaskView);
mTopRowIdSet.remove(dismissedTaskId);
@@ -2456,12 +2459,11 @@
mFocusedTaskId = finalNextFocusedTaskView.getTaskId();
mTopRowIdSet.remove(mFocusedTaskId);
finalNextFocusedTaskView.animateIconScaleAndDimIntoView();
- setCurrentPage(pageToSnapTo);
}
updateTaskSize(true);
// Update scroll and snap to page.
updateScrollSynchronously();
- snapToPageImmediately(pageToSnapTo);
+ setCurrentPage(pageToSnapTo);
dispatchScrollChanged();
}
}
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 204913a..1555e98 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -104,6 +104,10 @@
@ViewDebug.ExportedProperty(category = "launcher")
protected int mCurrentPage;
+ // Difference between current scroll position and mCurrentPage's page scroll. Used to maintain
+ // relative scroll position unchanged in updateCurrentPageScroll. Cleared when snapping to a
+ // page.
+ protected int mCurrentPageScrollDiff;
@ViewDebug.ExportedProperty(category = "launcher")
protected int mNextPage = INVALID_PAGE;
@@ -247,7 +251,7 @@
// If the current page is invalid, just reset the scroll position to zero
int newPosition = 0;
if (0 <= mCurrentPage && mCurrentPage < getPageCount()) {
- newPosition = getScrollForPage(mCurrentPage);
+ newPosition = getScrollForPage(mCurrentPage) + mCurrentPageScrollDiff;
}
mOrientationHandler.set(this, VIEW_SCROLL_TO, newPosition);
mScroller.startScroll(mScroller.getCurrX(), 0, newPosition - mScroller.getCurrX(), 0);
@@ -452,6 +456,7 @@
* to provide custom behavior during animation.
*/
protected void onPageEndTransition() {
+ mCurrentPageScrollDiff = 0;
AccessibilityManagerCompat.sendScrollFinishedEventToTest(getContext());
AccessibilityManagerCompat.sendCustomAccessibilityEvent(getPageAt(mCurrentPage),
AccessibilityEvent.TYPE_VIEW_FOCUSED, null);