Find page for widget starting at current page from overview.

Previously the search began with the page that the user
long-pressed to enter the overview, even if they then free-
scrolled to another page before selecting "Widgets."

Change-Id: Ie286f6864c78b573c05dd9d02c1346e17db711a6
This commit is contained in:
Tony Wickham
2015-09-10 09:12:12 -07:00
parent ee22b53707
commit 4cab3b550b
+2 -1
View File
@@ -1930,7 +1930,8 @@ public class Workspace extends PagedView
// Find a page that has enough space to place this widget (after rearranging/resizing).
// Start at the current page and search right (on LTR) until finding a page with enough
// space. Since an empty screen is the furthest right, a page must be found.
for (int pageIndex = getCurrentPage(); pageIndex <= getPageCount(); pageIndex++) {
int currentPageInOverview = getPageNearestToCenterOfScreen();
for (int pageIndex = currentPageInOverview; pageIndex < getPageCount(); pageIndex++) {
CellLayout page = (CellLayout) getPageAt(pageIndex);
if (page.hasReorderSolution(info)) {
setCurrentPage(pageIndex);