Stop clearing focus when snapping to a new workspace page.
Clearing the focus was causing the first child in the new page to
immediately take focus, which caused FocusIndicatorView jank when
using a keyboard.
Bug: 25256728
Change-Id: I5ab31ebc3fe370d7ac9e9792b30dab3467023738
diff --git a/src/com/android/launcher3/FocusHelper.java b/src/com/android/launcher3/FocusHelper.java
index 6872d5b..d5eac9b 100644
--- a/src/com/android/launcher3/FocusHelper.java
+++ b/src/com/android/launcher3/FocusHelper.java
@@ -397,7 +397,6 @@
if (newIconIndex == FocusLogic.PREVIOUS_PAGE_LEFT_COLUMN) {
newPageIndex = pageIndex - 1;
}
- workspace.snapToPage(newPageIndex);
row = ((CellLayout.LayoutParams) v.getLayoutParams()).cellY;
parent = getCellLayoutChildrenForIndex(workspace, newPageIndex);
if (parent != null) {
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 2579ea3..9258360 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -2078,11 +2078,6 @@
whichPage = validateNewPage(whichPage);
mNextPage = whichPage;
- View focusedChild = getFocusedChild();
- if (focusedChild != null && whichPage != mCurrentPage &&
- focusedChild == getPageAt(mCurrentPage)) {
- focusedChild.clearFocus();
- }
pageBeginMoving();
awakenScrollBars(duration);