diff options
author | Jonathan Miranda <jonmiranda@google.com> | 2017-07-13 18:00:52 +0000 |
---|---|---|
committer | Jonathan Miranda <jonmiranda@google.com> | 2017-07-13 18:00:52 +0000 |
commit | 36be1d3674436a1e50f89e4e801177af16e6450c (patch) | |
tree | 318c17e84ea3639f633a4c054b0b9d7a8a09059b /src/com/android/launcher3/folder | |
parent | c4b296a50ea50de64b377016e07ec041350489c8 (diff) | |
download | android_packages_apps_Trebuchet-36be1d3674436a1e50f89e4e801177af16e6450c.tar.gz android_packages_apps_Trebuchet-36be1d3674436a1e50f89e4e801177af16e6450c.tar.bz2 android_packages_apps_Trebuchet-36be1d3674436a1e50f89e4e801177af16e6450c.zip |
Revert "Update existing Folder items' ranks to match their pre-permutation layouts."
This reverts commit c4b296a50ea50de64b377016e07ec041350489c8.
Change-Id: Ieff7873edc3cb300fe454b0ad97d6f0b4f0cb5a9
Diffstat (limited to 'src/com/android/launcher3/folder')
-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 bc26fbef8..21631fa24 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; } } |