Merge "Focus doesn\'t leave folders without also closing them." into ub-launcher3-burnaby-polish

am: 298f1c4578

* commit '298f1c4578e45168e74aa4b8561fcd88bfe509fe':
  Focus doesn't leave folders without also closing them.
This commit is contained in:
Tony Wickham
2015-11-23 18:48:28 +00:00
committed by android-build-merger
2 changed files with 47 additions and 10 deletions
+16 -4
View File
@@ -397,16 +397,28 @@ public class FolderPagedView extends PagedView {
return !ALLOW_FOLDER_SCROLL && getItemCount() >= mMaxItemsPerPage;
}
public View getFirstItem() {
if (getChildCount() < 1) {
return null;
}
ShortcutAndWidgetContainer currContainer = getCurrentCellLayout().getShortcutsAndWidgets();
if (mGridCountX > 0) {
return currContainer.getChildAt(0, 0);
} else {
return currContainer.getChildAt(0);
}
}
public View getLastItem() {
if (getChildCount() < 1) {
return null;
}
ShortcutAndWidgetContainer lastContainer = getCurrentCellLayout().getShortcutsAndWidgets();
int lastRank = lastContainer.getChildCount() - 1;
ShortcutAndWidgetContainer currContainer = getCurrentCellLayout().getShortcutsAndWidgets();
int lastRank = currContainer.getChildCount() - 1;
if (mGridCountX > 0) {
return lastContainer.getChildAt(lastRank % mGridCountX, lastRank / mGridCountX);
return currContainer.getChildAt(lastRank % mGridCountX, lastRank / mGridCountX);
} else {
return lastContainer.getChildAt(lastRank);
return currContainer.getChildAt(lastRank);
}
}