diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-07-13 23:41:08 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-07-13 23:41:08 +0000 |
commit | 433bdedaa27cb8d748da0dc69ace85d051b599c9 (patch) | |
tree | 2225442e922022830cab62c6d331d014faa7e312 /src/com/android/launcher3/folder/FolderPagedView.java | |
parent | 3ebf6ccc36815478277dd6011557f08184e2e5cb (diff) | |
parent | 36be1d3674436a1e50f89e4e801177af16e6450c (diff) | |
download | android_packages_apps_Trebuchet-433bdedaa27cb8d748da0dc69ace85d051b599c9.tar.gz android_packages_apps_Trebuchet-433bdedaa27cb8d748da0dc69ace85d051b599c9.tar.bz2 android_packages_apps_Trebuchet-433bdedaa27cb8d748da0dc69ace85d051b599c9.zip |
Merge "Revert "Update existing Folder items' ranks to match their pre-permutation layouts."" into ub-launcher3-dorval-polish
Diffstat (limited to 'src/com/android/launcher3/folder/FolderPagedView.java')
-rw-r--r-- | src/com/android/launcher3/folder/FolderPagedView.java | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/src/com/android/launcher3/folder/FolderPagedView.java b/src/com/android/launcher3/folder/FolderPagedView.java index 33ac5baf2..9bf20feaf 100644 --- a/src/com/android/launcher3/folder/FolderPagedView.java +++ b/src/com/android/launcher3/folder/FolderPagedView.java @@ -755,10 +755,6 @@ public class FolderPagedView extends PagedView { return mMaxItemsPerPage; } - public int getReadingOrderPosForRank(int rank) { - return getReadingOrderPosForRank(rank, mMaxItemsPerPage, mGridCountX, sTmpArray); - } - /** * Returns the reading order position for a given rank. * @@ -767,44 +763,34 @@ public class FolderPagedView extends PagedView { * * R0 R1 R4 * R2 R3 R5 - * - * @param outXY If notnull, we also return the cell X/Y position. */ - public static int getReadingOrderPosForRank(int rank, int maxItemsPerPage, int gridX, - int[] outXY) { - outXY = outXY == null ? sTmpArray : outXY; - getCellXYPositionForRank(rank, maxItemsPerPage, gridX, outXY); - - if (rank >= maxItemsPerPage) { + public int getReadingOrderPosForRank(int rank) { + if (rank >= mMaxItemsPerPage) { return rank; } - return outXY[0] + (gridX * outXY[1]); - } - - public void getCellXYPositionForRank(int rank, int[] outXY) { - getCellXYPositionForRank(rank, mMaxItemsPerPage, mGridCountX, outXY); + getCellXYPositionForRank(rank, sTmpArray); + return sTmpArray[0] + (mGridCountX * sTmpArray[1]); } /** * Returns the cell XY position for a Folder item with the given rank. */ - public static void getCellXYPositionForRank(int rank, int maxItemsPerPage, int gridX, - int[] outXY) { - boolean onFirstPage = rank < maxItemsPerPage; + public void getCellXYPositionForRank(int rank, int[] outXY) { + boolean onFirstPage = rank < mMaxItemsPerPage; - if (onFirstPage && gridX == 3) { + if (onFirstPage && mGridCountX == 3) { outXY[0] = FolderPermutation.THREE_COLS[rank][0]; outXY[1] = FolderPermutation.THREE_COLS[rank][1]; - } else if (onFirstPage && gridX == 4) { + } else if (onFirstPage && mGridCountX == 4) { outXY[0] = FolderPermutation.FOUR_COLS[rank][0]; outXY[1] = FolderPermutation.FOUR_COLS[rank][1]; - } else if (onFirstPage && gridX == 5) { + } else if (onFirstPage && mGridCountX == 5) { outXY[0] = FolderPermutation.FIVE_COLS[rank][0]; outXY[1] = FolderPermutation.FIVE_COLS[rank][1]; } else { - outXY[0] = (rank % maxItemsPerPage) % gridX; - outXY[1] = (rank % maxItemsPerPage) / gridX; + outXY[0] = (rank % mMaxItemsPerPage) % mGridCountX; + outXY[1] = (rank % mMaxItemsPerPage) / mGridCountX; } } |