Adding a rank column for itemInfo
> Rank is used to determine position of an item
in a folder.
Bug: 18590192
Change-Id: I2826a7c570b4cc58e719d685f17a24ec6133804f
diff --git a/src/com/android/launcher3/ItemInfo.java b/src/com/android/launcher3/ItemInfo.java
index 09b77f7..aff8323 100644
--- a/src/com/android/launcher3/ItemInfo.java
+++ b/src/com/android/launcher3/ItemInfo.java
@@ -98,6 +98,11 @@
public int minSpanY = 1;
/**
+ * Indicates the position in an ordered list.
+ */
+ public int rank = 0;
+
+ /**
* Indicates that this item needs to be updated in the db
*/
public boolean requiresDbUpdate = false;
@@ -135,6 +140,7 @@
cellY = info.cellY;
spanX = info.spanX;
spanY = info.spanY;
+ rank = info.rank;
screenId = info.screenId;
itemType = info.itemType;
container = info.container;
@@ -161,6 +167,7 @@
values.put(LauncherSettings.Favorites.CELLY, cellY);
values.put(LauncherSettings.Favorites.SPANX, spanX);
values.put(LauncherSettings.Favorites.SPANY, spanY);
+ values.put(LauncherSettings.Favorites.RANK, rank);
long serialNumber = UserManagerCompat.getInstance(context).getSerialNumberForUser(user);
values.put(LauncherSettings.Favorites.PROFILE_ID, serialNumber);
@@ -170,11 +177,6 @@
}
}
- void updateValuesWithCoordinates(ContentValues values, int cellX, int cellY) {
- values.put(LauncherSettings.Favorites.CELLX, cellX);
- values.put(LauncherSettings.Favorites.CELLY, cellY);
- }
-
static byte[] flattenBitmap(Bitmap bitmap) {
// Try go guesstimate how much space the icon will take when serialized
// to avoid unnecessary allocations/copies during the write.