summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/ItemInfo.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-01-05 13:41:43 -0800
committerSunny Goyal <sunnygoyal@google.com>2015-01-13 22:19:56 +0000
commit08f7261d11a53ae4b330ad4fa897b8519de3d750 (patch)
tree277f1365cbe6ef9824a96be83d3db5e133ad94d3 /src/com/android/launcher3/ItemInfo.java
parente87e6abc3639559f2746171999fee352cb5bd946 (diff)
downloadandroid_packages_apps_Trebuchet-08f7261d11a53ae4b330ad4fa897b8519de3d750.tar.gz
android_packages_apps_Trebuchet-08f7261d11a53ae4b330ad4fa897b8519de3d750.tar.bz2
android_packages_apps_Trebuchet-08f7261d11a53ae4b330ad4fa897b8519de3d750.zip
Adding a rank column for itemInfo
> Rank is used to determine position of an item in a folder. Bug: 18590192 Change-Id: I2826a7c570b4cc58e719d685f17a24ec6133804f
Diffstat (limited to 'src/com/android/launcher3/ItemInfo.java')
-rw-r--r--src/com/android/launcher3/ItemInfo.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/android/launcher3/ItemInfo.java b/src/com/android/launcher3/ItemInfo.java
index 09b77f756..aff8323c2 100644
--- a/src/com/android/launcher3/ItemInfo.java
+++ b/src/com/android/launcher3/ItemInfo.java
@@ -98,6 +98,11 @@ public class ItemInfo {
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 @@ public class ItemInfo {
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 @@ public class ItemInfo {
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 @@ public class ItemInfo {
}
}
- 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.