From 92f3d46cf35e78891f73226e81f8ca7e9a7f4d92 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Tue, 22 Nov 2011 21:02:29 -0800 Subject: Clean up unused code and import declarations Change-Id: If36fd2d99a51b07290b13f697b3ea08d31feb023 --- .../android/launcher2/AppsCustomizePagedView.java | 22 +--------------------- src/com/android/launcher2/BubbleTextView.java | 5 ++--- src/com/android/launcher2/ButtonDropTarget.java | 1 - src/com/android/launcher2/CellLayout.java | 1 - src/com/android/launcher2/DeleteDropTarget.java | 1 - src/com/android/launcher2/DragController.java | 1 - src/com/android/launcher2/DragLayer.java | 1 - src/com/android/launcher2/FocusHelper.java | 8 -------- src/com/android/launcher2/FolderIcon.java | 1 - src/com/android/launcher2/HandleView.java | 5 ----- src/com/android/launcher2/IconCache.java | 1 - src/com/android/launcher2/Launcher.java | 12 ------------ .../launcher2/LauncherAppWidgetHostView.java | 4 ---- src/com/android/launcher2/LauncherApplication.java | 2 -- src/com/android/launcher2/LauncherModel.java | 3 +-- src/com/android/launcher2/PagedViewCellLayout.java | 1 - src/com/android/launcher2/PagedViewWidget.java | 2 -- src/com/android/launcher2/RocketLauncher.java | 17 ++++------------- .../launcher2/WallpaperChooserDialogFragment.java | 6 +----- src/com/android/launcher2/Workspace.java | 5 ----- 20 files changed, 9 insertions(+), 90 deletions(-) (limited to 'src/com') diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index b732eecdc..7f0edde75 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -24,7 +24,6 @@ import android.appwidget.AppWidgetProviderInfo; import android.content.ComponentName; import android.content.Context; import android.content.Intent; -import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.res.Configuration; @@ -443,22 +442,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen super.onMeasure(widthMeasureSpec, heightMeasureSpec); } - /** Removes and returns the ResolveInfo with the specified ComponentName */ - private ResolveInfo removeResolveInfoWithComponentName(List list, - ComponentName cn) { - Iterator iter = list.iterator(); - while (iter.hasNext()) { - ResolveInfo rinfo = iter.next(); - ActivityInfo info = rinfo.activityInfo; - ComponentName c = new ComponentName(info.packageName, info.name); - if (c.equals(cn)) { - iter.remove(); - return rinfo; - } - } - return null; - } - public void onPackagesUpdated() { // TODO: this isn't ideal, but we actually need to delay here. This call is triggered // by a broadcast receiver, and in order for it to work correctly, we need to know that @@ -992,10 +975,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen private void renderDrawableToBitmap(Drawable d, Bitmap bitmap, int x, int y, int w, int h) { renderDrawableToBitmap(d, bitmap, x, y, w, h, 1f, 0xFFFFFFFF); } - private void renderDrawableToBitmap(Drawable d, Bitmap bitmap, int x, int y, int w, int h, - float scale) { - renderDrawableToBitmap(d, bitmap, x, y, w, h, scale, 0xFFFFFFFF); - } + private void renderDrawableToBitmap(Drawable d, Bitmap bitmap, int x, int y, int w, int h, float scale, int multiplyColor) { if (bitmap != null) { diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java index 49c47cef7..dc498a403 100644 --- a/src/com/android/launcher2/BubbleTextView.java +++ b/src/com/android/launcher2/BubbleTextView.java @@ -16,8 +16,6 @@ package com.android.launcher2; -import com.android.launcher.R; - import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; @@ -30,9 +28,10 @@ import android.graphics.Region.Op; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.MotionEvent; -import android.view.View; import android.widget.TextView; +import com.android.launcher.R; + /** * TextView that draws a bubble behind the text. We cannot use a LineBackgroundSpan * because we want to make the bubble taller than the text and TextView's clip is diff --git a/src/com/android/launcher2/ButtonDropTarget.java b/src/com/android/launcher2/ButtonDropTarget.java index 868ede836..4ff7c9669 100644 --- a/src/com/android/launcher2/ButtonDropTarget.java +++ b/src/com/android/launcher2/ButtonDropTarget.java @@ -20,7 +20,6 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.Paint; import android.util.AttributeSet; -import android.widget.FrameLayout; import android.widget.TextView; import com.android.launcher.R; diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java index 6e6028077..8aae809b9 100644 --- a/src/com/android/launcher2/CellLayout.java +++ b/src/com/android/launcher2/CellLayout.java @@ -18,7 +18,6 @@ package com.android.launcher2; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; -import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.animation.TimeInterpolator; diff --git a/src/com/android/launcher2/DeleteDropTarget.java b/src/com/android/launcher2/DeleteDropTarget.java index 4e93b22b1..f19970823 100644 --- a/src/com/android/launcher2/DeleteDropTarget.java +++ b/src/com/android/launcher2/DeleteDropTarget.java @@ -23,7 +23,6 @@ import android.content.res.Resources; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.Rect; -import android.graphics.drawable.Drawable; import android.graphics.drawable.TransitionDrawable; import android.util.AttributeSet; import android.view.View; diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index 286e2fe6d..a120ac569 100644 --- a/src/com/android/launcher2/DragController.java +++ b/src/com/android/launcher2/DragController.java @@ -20,7 +20,6 @@ import android.content.Context; import android.graphics.Bitmap; import android.graphics.Point; import android.graphics.Rect; -import android.graphics.RectF; import android.os.Handler; import android.os.IBinder; import android.os.Vibrator; diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java index 3c626d46d..873803d22 100644 --- a/src/com/android/launcher2/DragLayer.java +++ b/src/com/android/launcher2/DragLayer.java @@ -199,7 +199,6 @@ public class DragLayer extends FrameLayout { private void sendTapOutsideFolderAccessibilityEvent(boolean isEditingName) { if (AccessibilityManager.getInstance(mContext).isEnabled()) { - Folder currentFolder = mLauncher.getWorkspace().getOpenFolder(); int stringId = isEditingName ? R.string.folder_tap_to_rename : R.string.folder_tap_to_close; AccessibilityEvent event = AccessibilityEvent.obtain( AccessibilityEvent.TYPE_VIEW_FOCUSED); diff --git a/src/com/android/launcher2/FocusHelper.java b/src/com/android/launcher2/FocusHelper.java index 1a7416a99..7807b5dcf 100644 --- a/src/com/android/launcher2/FocusHelper.java +++ b/src/com/android/launcher2/FocusHelper.java @@ -23,7 +23,6 @@ import android.view.ViewGroup; import android.view.ViewParent; import android.widget.TabHost; import android.widget.TabWidget; -import android.widget.TextView; import com.android.launcher.R; @@ -117,13 +116,6 @@ public class FocusHelper { return wasHandled; } - /** - * Private helper to determine whether a view is visible. - */ - private static boolean isVisible(View v) { - return v.getVisibility() == View.VISIBLE; - } - /** * Returns the Viewgroup containing page contents for the page at the index specified. */ diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java index 546f4b53c..3c0829d4a 100644 --- a/src/com/android/launcher2/FolderIcon.java +++ b/src/com/android/launcher2/FolderIcon.java @@ -32,7 +32,6 @@ import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.view.accessibility.AccessibilityEvent; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.widget.ImageView; diff --git a/src/com/android/launcher2/HandleView.java b/src/com/android/launcher2/HandleView.java index e2e5745c5..13d07e2dd 100644 --- a/src/com/android/launcher2/HandleView.java +++ b/src/com/android/launcher2/HandleView.java @@ -71,11 +71,6 @@ public class HandleView extends ImageView { return super.onTouchEvent(ev); } - private static boolean isDirectionKey(int keyCode) { - return keyCode == KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_LEFT || - keyCode == KeyEvent.KEYCODE_DPAD_RIGHT || keyCode == KeyEvent.KEYCODE_DPAD_UP; - } - void setLauncher(Launcher launcher) { mLauncher = launcher; } diff --git a/src/com/android/launcher2/IconCache.java b/src/com/android/launcher2/IconCache.java index a0412af35..2430a6b33 100644 --- a/src/com/android/launcher2/IconCache.java +++ b/src/com/android/launcher2/IconCache.java @@ -221,7 +221,6 @@ public class IconCache { public HashMap getAllIcons() { synchronized (mCache) { HashMap set = new HashMap(); - int i = 0; for (ComponentName cn : mCache.keySet()) { final CacheEntry e = mCache.get(cn); set.put(cn, e.icon); diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 33ead5cf8..f9c7bf070 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1398,11 +1398,6 @@ public final class Launcher extends Activity return mWorkspaceLoading || mWaitingForResult; } - private void addItems() { - showWorkspace(true); - showAddDialog(); - } - private void resetAddInfo() { mPendingAddInfo.container = ItemInfo.NO_ID; mPendingAddInfo.screen = -1; @@ -1560,13 +1555,6 @@ public final class Launcher extends Activity sFolders.remove(folder.id); } - private void showNotifications() { - final StatusBarManager statusBar = (StatusBarManager) getSystemService(STATUS_BAR_SERVICE); - if (statusBar != null) { - statusBar.expand(); - } - } - private void startWallpaper() { showWorkspace(true); final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER); diff --git a/src/com/android/launcher2/LauncherAppWidgetHostView.java b/src/com/android/launcher2/LauncherAppWidgetHostView.java index 71860f362..0c3bdcaf8 100644 --- a/src/com/android/launcher2/LauncherAppWidgetHostView.java +++ b/src/com/android/launcher2/LauncherAppWidgetHostView.java @@ -17,9 +17,7 @@ package com.android.launcher2; import android.appwidget.AppWidgetHostView; -import android.appwidget.AppWidgetProviderInfo; import android.content.Context; -import android.content.res.Resources; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -35,12 +33,10 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView { private boolean mHasPerformedLongPress; private CheckForLongPress mPendingCheckForLongPress; private LayoutInflater mInflater; - private Launcher mLauncher; public LauncherAppWidgetHostView(Context context) { super(context); mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - mLauncher = (Launcher) context; } @Override diff --git a/src/com/android/launcher2/LauncherApplication.java b/src/com/android/launcher2/LauncherApplication.java index 6c8ba2425..9936ca682 100644 --- a/src/com/android/launcher2/LauncherApplication.java +++ b/src/com/android/launcher2/LauncherApplication.java @@ -25,8 +25,6 @@ import android.content.IntentFilter; import android.content.res.Configuration; import android.database.ContentObserver; import android.os.Handler; -import android.view.accessibility.AccessibilityEvent; -import android.view.accessibility.AccessibilityManager; import java.lang.ref.WeakReference; diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 50a36a5b7..e2ddf1b49 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -58,7 +58,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; -import java.util.Locale; /** * Maintains in-memory state of the Launcher. It is expected that there should be only one @@ -1347,7 +1346,7 @@ public class LauncherModel extends BroadcastReceiver { // shallow copy final ArrayList list - = (ArrayList)mAllAppsList.data.clone(); + = (ArrayList) mAllAppsList.data.clone(); mHandler.post(new Runnable() { public void run() { final long t = SystemClock.uptimeMillis(); diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java index c29e50d6f..58b87dc8e 100644 --- a/src/com/android/launcher2/PagedViewCellLayout.java +++ b/src/com/android/launcher2/PagedViewCellLayout.java @@ -19,7 +19,6 @@ package com.android.launcher2; import android.content.Context; import android.content.res.Resources; import android.util.AttributeSet; -import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.ViewDebug; diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java index 9e668fd3c..8fcfa8fed 100644 --- a/src/com/android/launcher2/PagedViewWidget.java +++ b/src/com/android/launcher2/PagedViewWidget.java @@ -42,8 +42,6 @@ import com.android.launcher.R; public class PagedViewWidget extends LinearLayout implements Checkable { static final String TAG = "PagedViewWidgetLayout"; - private static final int sPreviewFadeInDuration = 80; - private static final int sPreviewFadeInStaggerDuration = 20; private static boolean sDeletePreviewsWhenDetachedFromWindow = true; private final Paint mPaint = new Paint(); diff --git a/src/com/android/launcher2/RocketLauncher.java b/src/com/android/launcher2/RocketLauncher.java index 1c6510fa5..505ac4c9e 100644 --- a/src/com/android/launcher2/RocketLauncher.java +++ b/src/com/android/launcher2/RocketLauncher.java @@ -21,38 +21,29 @@ package com.android.launcher2; import android.animation.AnimatorSet; -import android.animation.PropertyValuesHolder; import android.animation.ObjectAnimator; import android.animation.TimeAnimator; -import android.app.Activity; import android.content.ComponentName; import android.content.Context; import android.content.Intent; -import android.support.v13.dreams.BasicDream; import android.graphics.Bitmap; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.Matrix; -import android.graphics.Paint; import android.graphics.Point; import android.graphics.Rect; -import android.graphics.RectF; import android.os.Handler; +import android.support.v13.dreams.BasicDream; import android.util.AttributeSet; import android.util.DisplayMetrics; -import android.util.Pair; -import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; -import android.view.WindowManager; import android.widget.FrameLayout; import android.widget.ImageView; -import java.util.HashMap; -import java.util.Random; import com.android.launcher.R; +import java.util.HashMap; +import java.util.Random; + public class RocketLauncher extends BasicDream { public static final boolean ROCKET_LAUNCHER = true; diff --git a/src/com/android/launcher2/WallpaperChooserDialogFragment.java b/src/com/android/launcher2/WallpaperChooserDialogFragment.java index 6e39da27f..7c4ac2e33 100644 --- a/src/com/android/launcher2/WallpaperChooserDialogFragment.java +++ b/src/com/android/launcher2/WallpaperChooserDialogFragment.java @@ -16,7 +16,6 @@ package com.android.launcher2; import android.app.Activity; -import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.app.WallpaperManager; @@ -27,20 +26,17 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.ColorFilter; -import android.graphics.Paint; import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; import android.view.View.OnClickListener; +import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.BaseAdapter; -import android.widget.FrameLayout; import android.widget.Gallery; -import android.widget.GridView; import android.widget.ImageView; import android.widget.ListAdapter; import android.widget.SpinnerAdapter; diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index d4e8ad484..e1377fcc2 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -1521,8 +1521,6 @@ public class Workspace extends SmoothPagedView // We need to add extra padding to the bitmap to make room for the glow effect final int bitmapPadding = HolographicOutlineHelper.MAX_OUTER_BLUR_RADIUS; - CellLayout cl = (CellLayout) getChildAt(0); - int[] size = estimateItemSize(info.spanX, info.spanY, info, false); // The outline is used to visualize where the item will land if dropped @@ -1872,9 +1870,6 @@ public class Workspace extends SmoothPagedView * Returns a new bitmap to be used as the object outline, e.g. to visualize the drop location. * Responsibility for the bitmap is transferred to the caller. */ - private Bitmap createDragOutline(Bitmap orig, Canvas canvas, int padding, int w, int h) { - return createDragOutline(orig, canvas, padding, w, h, null); - } private Bitmap createDragOutline(Bitmap orig, Canvas canvas, int padding, int w, int h, Paint alphaClipPaint) { final int outlineColor = getResources().getColor(android.R.color.holo_blue_light); -- cgit v1.2.3