summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Workspace.java
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2015-09-27 15:43:53 -0700
committerDanesh M <daneshm90@gmail.com>2015-09-27 15:43:53 -0700
commit6d5f97506bc6b93471d7e29bd2cbd996895cc0d7 (patch)
treed2b5d2d37a57b2c472f8ea2653df1356dd04e626 /src/com/android/launcher3/Workspace.java
parent7d020886d2b81a8523dc9f06d2dd078e65107def (diff)
downloadandroid_packages_apps_Trebuchet-6d5f97506bc6b93471d7e29bd2cbd996895cc0d7.tar.gz
android_packages_apps_Trebuchet-6d5f97506bc6b93471d7e29bd2cbd996895cc0d7.tar.bz2
android_packages_apps_Trebuchet-6d5f97506bc6b93471d7e29bd2cbd996895cc0d7.zip
Revert "Show apps as unavailable when on unmounted storage"
This reverts commit 53b6e9dd1a97ea59a84e4c8b7172e1773d990ee5.
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r--src/com/android/launcher3/Workspace.java84
1 files changed, 0 insertions, 84 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 5efe8d41c..e34edf32a 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -4953,90 +4953,6 @@ public class Workspace extends SmoothPagedView
stripEmptyScreens();
}
- void updateUnvailableItemsInCellLayout(CellLayout parent, ArrayList<String> packages) {
- final HashSet<String> packageNames = new HashSet<String>();
- packageNames.addAll(packages);
-
- ViewGroup layout = parent.getShortcutsAndWidgets();
- int childCount = layout.getChildCount();
- for (int i = 0; i < childCount; ++i) {
- View view = layout.getChildAt(i);
- if (view instanceof BubbleTextView) {
- ItemInfo info = (ItemInfo) view.getTag();
- if (info instanceof ShortcutInfo) {
- Intent intent = info.getIntent();
- ComponentName cn = intent != null ? intent.getComponent() : null;
- if (cn != null && packageNames.contains(cn.getPackageName())) {
- ShortcutInfo shortcut = (ShortcutInfo) info;
- if (!shortcut.isDisabled) {
- shortcut.isDisabled = true;
- ((BubbleTextView) view)
- .applyFromShortcutInfo(shortcut, mIconCache, true);
- }
- }
- }
- } else if (view instanceof FolderIcon) {
- final Folder folder = ((FolderIcon)view).getFolder();
- updateUnvailableItemsInCellLayout(folder.getContent(), packages);
- folder.invalidate();
- }
- }
- }
-
- void updateUnavailableItemsByPackageName(final ArrayList<String> packages) {
- ArrayList<CellLayout> cellLayouts = getWorkspaceAndHotseatCellLayouts();
- for (CellLayout layoutParent : cellLayouts) {
- updateUnvailableItemsInCellLayout(layoutParent, packages);
- }
- }
-
- /**
- * Updates shortcuts to an app that was previously unavailable in the given cell layout
- * @param parent CellLayout to check childen for shortcuts to the available app
- * @param appInfos List of item infos. Items are assumed to be of type AppInfo
- */
- void updateAvailabeItemsInCellLayout(CellLayout parent, final ArrayList<ItemInfo> appInfos) {
- ViewGroup layout = parent.getShortcutsAndWidgets();
- int childCount = layout.getChildCount();
- for (int i = 0; i < childCount; ++i) {
- View view = layout.getChildAt(i);
- if (view instanceof BubbleTextView) {
- ItemInfo info = (ItemInfo) view.getTag();
- if (info instanceof ShortcutInfo) {
- Intent intent = info.getIntent();
- ComponentName cn = intent != null ? intent.getComponent() : null;
- for (ItemInfo itemInfo : appInfos) {
- AppInfo appInfo = (AppInfo) itemInfo;
- if (cn != null && cn.getPackageName().equals(
- appInfo.componentName.getPackageName())) {
- ShortcutInfo shortcut = (ShortcutInfo) info;
- if (shortcut.isDisabled) {
- shortcut.isDisabled = false;
- ((BubbleTextView) view)
- .applyFromShortcutInfo(shortcut, mIconCache, true);
- }
- }
- }
- }
- } else if (view instanceof FolderIcon) {
- final Folder folder = ((FolderIcon)view).getFolder();
- updateAvailabeItemsInCellLayout(folder.getContent(), appInfos);
- folder.invalidate();
- }
- }
- }
-
- /**
- * Updates shortcuts to an app that was previously unavailable
- * @param appInfos List of item infos. Items are assumed to be of type AppInfo
- */
- void updateAvailableItems(final ArrayList<ItemInfo> appInfos) {
- ArrayList<CellLayout> cellLayouts = getWorkspaceAndHotseatCellLayouts();
- for (CellLayout layoutParent : cellLayouts) {
- updateAvailabeItemsInCellLayout(layoutParent, appInfos);
- }
- }
-
interface ItemOperator {
/**
* Process the next itemInfo, possibly with side-effect on {@link ItemOperator#value}.