Handling getLastItem when the folder is closed
Change-Id: I6afebd7c0a92edb25e3658e7f860244d7457c852
This commit is contained in:
@@ -245,7 +245,13 @@ public class FolderCellLayout extends CellLayout implements Folder.FolderContent
|
||||
@Override
|
||||
public View getLastItem() {
|
||||
int lastRank = getShortcutsAndWidgets().getChildCount() - 1;
|
||||
return getShortcutsAndWidgets().getChildAt(lastRank % getCountX(), lastRank / getCountX());
|
||||
// count can be zero if the folder is not yet laid out.
|
||||
int count = getCountX();
|
||||
if (count > 0) {
|
||||
return getShortcutsAndWidgets().getChildAt(lastRank % count, lastRank / count);
|
||||
} else {
|
||||
return getShortcutsAndWidgets().getChildAt(lastRank);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user