summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-03-05 14:56:29 -0800
committerSunny Goyal <sunnygoyal@google.com>2015-03-05 14:56:29 -0800
commit82e861d71aaefcdec47d78bf564d755d2910ecb8 (patch)
tree3c7cf4f45b295df4b12ba57e189ec491dffb7d4b /src
parent49b39d667d3fa662352fdcc5278db97ab45de7cf (diff)
downloadandroid_packages_apps_Trebuchet-82e861d71aaefcdec47d78bf564d755d2910ecb8.tar.gz
android_packages_apps_Trebuchet-82e861d71aaefcdec47d78bf564d755d2910ecb8.tar.bz2
android_packages_apps_Trebuchet-82e861d71aaefcdec47d78bf564d755d2910ecb8.zip
Using unique view id for each item in folder
Change-Id: I413de3db94dbab54a9c1e5799286ac78a1ae5102
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/FolderCellLayout.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/launcher3/FolderCellLayout.java b/src/com/android/launcher3/FolderCellLayout.java
index 21f2a1112..e6e9199e8 100644
--- a/src/com/android/launcher3/FolderCellLayout.java
+++ b/src/com/android/launcher3/FolderCellLayout.java
@@ -135,7 +135,7 @@ public class FolderCellLayout extends CellLayout implements Folder.FolderContent
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) view.getLayoutParams();
lp.cellX = item.cellX;
lp.cellY = item.cellY;
- addViewToCellLayout(view, -1, (int) item.id, lp, true);
+ addViewToCellLayout(view, -1, mFolder.mLauncher.getViewIdForItem(item), lp, true);
}
/**
@@ -159,7 +159,7 @@ public class FolderCellLayout extends CellLayout implements Folder.FolderContent
CellLayout.LayoutParams lp = new CellLayout.LayoutParams(
item.cellX, item.cellY, item.spanX, item.spanY);
- addViewToCellLayout(textView, -1, (int)item.id, lp, true);
+ addViewToCellLayout(textView, -1, mFolder.mLauncher.getViewIdForItem(item), lp, true);
return textView;
}
@@ -211,7 +211,7 @@ public class FolderCellLayout extends CellLayout implements Folder.FolderContent
lp.cellX = info.cellX;
lp.cellY = info.cellY;
rank ++;
- addViewToCellLayout(v, -1, (int)info.id, lp, true);
+ addViewToCellLayout(v, -1, mFolder.mLauncher.getViewIdForItem(info), lp, true);
}
}
@@ -244,8 +244,8 @@ public class FolderCellLayout extends CellLayout implements Folder.FolderContent
@Override
public View getLastItem() {
- int total = getShortcutsAndWidgets().getChildCount();
- return getShortcutsAndWidgets().getChildAt(total % getCountX(), total / getCountX());
+ int lastRank = getShortcutsAndWidgets().getChildCount() - 1;
+ return getShortcutsAndWidgets().getChildAt(lastRank % getCountX(), lastRank / getCountX());
}
@Override