diff options
Diffstat (limited to 'src/com/android/launcher3/Folder.java')
-rw-r--r-- | src/com/android/launcher3/Folder.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java index e4f935cf3..7267f327c 100644 --- a/src/com/android/launcher3/Folder.java +++ b/src/com/android/launcher3/Folder.java @@ -299,7 +299,9 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList public void modifyProtectedApps(boolean protect) { ArrayList<ComponentName> components = new ArrayList<ComponentName>(); for (Pair<ComponentName, CharSequence> item : getComponents()) { - components.add(item.first); + if (item.first != null) { + components.add(item.first); + } } Intent intent = new Intent(); @@ -1490,6 +1492,18 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList return null; } + public ShortcutInfo getShortcutForPosition(int position) { + if (position < 0 || position >= mItemsInReadingOrder.size()) { + return null; + } + View v = mItemsInReadingOrder.get(position); + Object tag = v.getTag(); + if (tag instanceof ShortcutInfo) { + return (ShortcutInfo) tag; + } + return null; + } + public void getLocationInDragLayer(int[] loc) { mLauncher.getDragLayer().getLocationInDragLayer(this, loc); } |