From 5974adcc7261a006f4f3857074568d49bd05e1f4 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 25 Oct 2010 14:29:11 -0700 Subject: Removing the Folders tab. Change-Id: I5cf3aa8bf987500800340e047336233db5eb0491 --- src/com/android/launcher2/CustomizePagedView.java | 68 ++--------------------- src/com/android/launcher2/Launcher.java | 7 --- 2 files changed, 6 insertions(+), 69 deletions(-) diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java index a01f1c083..5cfc38fb1 100644 --- a/src/com/android/launcher2/CustomizePagedView.java +++ b/src/com/android/launcher2/CustomizePagedView.java @@ -16,7 +16,10 @@ package com.android.launcher2; -import com.android.launcher.R; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProviderInfo; @@ -28,12 +31,11 @@ import android.content.pm.ResolveInfo; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Bitmap; +import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Rect; -import android.graphics.Bitmap.Config; import android.graphics.Region.Op; import android.graphics.drawable.Drawable; -import android.provider.LiveFolders; import android.util.AttributeSet; import android.util.Log; import android.view.ActionMode; @@ -41,18 +43,12 @@ import android.view.Gravity; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; -import android.view.MotionEvent; import android.view.View; -import android.view.ViewGroup; -import android.widget.Checkable; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; +import com.android.launcher.R; public class CustomizePagedView extends PagedView implements View.OnLongClickListener, View.OnClickListener, @@ -60,7 +56,6 @@ public class CustomizePagedView extends PagedView public enum CustomizationType { WidgetCustomization, - FolderCustomization, ShortcutCustomization, WallpaperCustomization, ApplicationCustomization @@ -89,7 +84,6 @@ public class CustomizePagedView extends PagedView // The raw sources of data for each of the different tabs of the customization page private List mWidgetList; - private List mFolderList; private List mShortcutList; private List mWallpaperList; private List mApps; @@ -256,18 +250,6 @@ public class CustomizePagedView extends PagedView } }; - // get the list of live folder intents - Intent liveFolderIntent = new Intent(LiveFolders.ACTION_CREATE_LIVE_FOLDER); - mFolderList = mPackageManager.queryIntentActivities(liveFolderIntent, 0); - - // manually create a separate entry for creating a folder in Launcher - ResolveInfo folder = new ResolveInfo(); - folder.icon = R.drawable.ic_launcher_folder; - folder.labelRes = R.string.group_folder; - folder.resolvePackageName = context.getPackageName(); - mFolderList.add(0, folder); - Collections.sort(mFolderList, resolveInfoComparator); - // get the list of shortcuts Intent shortcutsIntent = new Intent(Intent.ACTION_CREATE_SHORTCUT); mShortcutList = mPackageManager.queryIntentActivities(shortcutsIntent, 0); @@ -321,10 +303,6 @@ public class CustomizePagedView extends PagedView mChoiceModeTitleText = R.string.cab_app_selection_text; enterChoiceMode = true; break; - case FolderCustomization: - mChoiceModeTitleText = R.string.cab_folder_selection_text; - enterChoiceMode = true; - break; case ShortcutCustomization: mChoiceModeTitleText = R.string.cab_shortcut_selection_text; enterChoiceMode = true; @@ -403,19 +381,6 @@ public class CustomizePagedView extends PagedView // Cleanup the icon b.recycle(); return true; - case FolderCustomization: - if (v.getTag() instanceof UserFolderInfo) { - // The UserFolderInfo tag is only really used for live folders - UserFolderInfo folderInfo = (UserFolderInfo) v.getTag(); - mDragController.startDrag( - v, this, folderInfo, DragController.DRAG_ACTION_COPY, null); - } else { - createItemInfo = (PendingAddItemInfo) v.getTag(); - mDragController.startDrag( - v, this, createItemInfo, DragController.DRAG_ACTION_COPY, null); - } - mLauncher.getWorkspace().onDragStartedWithItemSpans(1, 1); - return true; case ShortcutCustomization: createItemInfo = (PendingAddItemInfo) v.getTag(); mDragController.startDrag( @@ -645,20 +610,6 @@ public class CustomizePagedView extends PagedView case WallpaperCustomization: icon.setOnClickListener(this); break; - case FolderCustomization: - if (info.labelRes != R.string.group_folder) { - createItemInfo.itemType = LauncherSettings.Favorites.ITEM_TYPE_LIVE_FOLDER; - createItemInfo.componentName = new ComponentName(info.activityInfo.packageName, - info.activityInfo.name); - icon.setTag(createItemInfo); - } else { - UserFolderInfo folderInfo = new UserFolderInfo(); - folderInfo.title = getResources().getText(R.string.folder_name); - icon.setTag(folderInfo); - } - icon.setOnClickListener(this); - icon.setOnLongClickListener(this); - break; case ShortcutCustomization: createItemInfo.itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT; createItemInfo.componentName = new ComponentName(info.activityInfo.packageName, @@ -727,10 +678,6 @@ public class CustomizePagedView extends PagedView case WidgetCustomization: syncWidgetPages(); break; - case FolderCustomization: - syncListPages(mFolderList); - centerPagedViewCellLayouts = true; - break; case ShortcutCustomization: syncListPages(mShortcutList); centerPagedViewCellLayouts = true; @@ -773,9 +720,6 @@ public class CustomizePagedView extends PagedView case WidgetCustomization: syncWidgetPageItems(page); break; - case FolderCustomization: - syncListPageItems(page, mFolderList); - break; case ShortcutCustomization: syncListPageItems(page, mShortcutList); break; diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 9eddbf206..5d45d2714 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -165,7 +165,6 @@ public final class Launcher extends Activity // tags for the customization tabs private static final String WIDGETS_TAG = "widgets"; private static final String APPLICATIONS_TAG = "applications"; - private static final String FOLDERS_TAG = "folders"; private static final String SHORTCUTS_TAG = "shortcuts"; private static final String WALLPAPERS_TAG = "wallpapers"; @@ -288,9 +287,6 @@ public final class Launcher extends Activity String applicationsLabel = getString(R.string.applications_tab_label); mHomeCustomizationDrawer.addTab(mHomeCustomizationDrawer.newTabSpec(APPLICATIONS_TAG) .setIndicator(applicationsLabel).setContent(contentFactory)); - String foldersLabel = getString(R.string.folders_tab_label); - mHomeCustomizationDrawer.addTab(mHomeCustomizationDrawer.newTabSpec(FOLDERS_TAG) - .setIndicator(foldersLabel).setContent(contentFactory)); String wallpapersLabel = getString(R.string.wallpapers_tab_label); mHomeCustomizationDrawer.addTab(mHomeCustomizationDrawer.newTabSpec(WALLPAPERS_TAG) .setIndicator(wallpapersLabel).setContent(contentFactory)); @@ -316,9 +312,6 @@ public final class Launcher extends Activity } else if (tag == APPLICATIONS_TAG) { mCustomizePagedView.setCustomizationFilter( CustomizePagedView.CustomizationType.ApplicationCustomization); - } else if (tag == FOLDERS_TAG) { - mCustomizePagedView.setCustomizationFilter( - CustomizePagedView.CustomizationType.FolderCustomization); } else if (tag == WALLPAPERS_TAG) { mCustomizePagedView.setCustomizationFilter( CustomizePagedView.CustomizationType.WallpaperCustomization); -- cgit v1.2.3