diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java index 75d8745529..207000522e 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java @@ -16,7 +16,7 @@ package com.android.launcher3; -import android.Manifest.permission; +import android.Manifest; import android.animation.LayoutTransition; import android.annotation.TargetApi; import android.app.ActionBar; @@ -38,7 +38,6 @@ import android.graphics.PorterDuff; import android.graphics.RectF; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; -import android.Manifest; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; diff --git a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java index b1d51ece04..10fdd87466 100644 --- a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java +++ b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java @@ -13,7 +13,6 @@ import android.os.AsyncTask; import android.util.Log; import com.android.launcher3.LauncherSettings.Favorites; -import com.android.launcher3.compat.AppWidgetManagerCompat; import java.util.ArrayList; import java.util.List; diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java index ae6e3ba0b2..bf5bc178e7 100644 --- a/src/com/android/launcher3/DeleteDropTarget.java +++ b/src/com/android/launcher3/DeleteDropTarget.java @@ -111,7 +111,6 @@ public class DeleteDropTarget extends ButtonDropTarget { public void onFlingToDelete(final DragObject d, PointF vel) { // Don't highlight the icon as it's animating d.dragView.setColor(0); - d.dragView.updateInitialScaleToCurrentScale(); final DragLayer dragLayer = mLauncher.getDragLayer(); FlingAnimation fling = new FlingAnimation(d, vel, diff --git a/src/com/android/launcher3/DragView.java b/src/com/android/launcher3/DragView.java index 89577353bd..c9dc9f1c66 100644 --- a/src/com/android/launcher3/DragView.java +++ b/src/com/android/launcher3/DragView.java @@ -21,6 +21,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.FloatArrayEvaluator; import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; +import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.content.res.Resources; import android.graphics.Bitmap; @@ -34,9 +35,7 @@ import android.graphics.Rect; import android.os.Build; import android.view.View; import android.view.animation.DecelerateInterpolator; - import com.android.launcher3.util.Thunk; - import java.util.Arrays; public class DragView extends View { @@ -53,12 +52,11 @@ public class DragView extends View { private Point mDragVisualizeOffset = null; private Rect mDragRegion = null; private final DragLayer mDragLayer; - private final DragController mDragController; + @Thunk final DragController mDragController; private boolean mHasDrawn = false; @Thunk float mCrossFadeProgress = 0f; ValueAnimator mAnim; - private float mInitialScale = 1f; // The intrinsic icon scale factor is the scale factor for a drag icon over the workspace // size. This is ignored for non-icons. private float mIntrinsicIconScale = 1f; @@ -83,7 +81,6 @@ public class DragView extends View { super(launcher); mDragLayer = launcher.getDragLayer(); mDragController = launcher.getDragController(); - mInitialScale = initialScale; final Resources res = getResources(); final float scaleDps = res.getDimensionPixelSize(R.dimen.dragViewScale); @@ -178,16 +175,13 @@ public class DragView extends View { return mDragRegion; } - public void updateInitialScaleToCurrentScale() { - mInitialScale = getScaleX(); - } - @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMeasuredDimension(mBitmap.getWidth(), mBitmap.getHeight()); } // Draws drag shadow for system DND. + @SuppressLint("WrongCall") public void drawDragShadow(Canvas canvas) { final int saveCount = canvas.save(Canvas.MATRIX_SAVE_FLAG); canvas.scale(getScaleX(), getScaleY()); diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 17fdeb1dc8..a9cff5e653 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -17,8 +17,6 @@ package com.android.launcher3; import android.content.Context; -import android.content.res.Configuration; -import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.util.AttributeSet; diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java index f2613875c6..3ceca94170 100644 --- a/src/com/android/launcher3/LauncherAppState.java +++ b/src/com/android/launcher3/LauncherAppState.java @@ -20,7 +20,6 @@ import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.os.UserManager; import android.util.Log; import com.android.launcher3.accessibility.LauncherAccessibilityDelegate; diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 03c87116c2..b390f13ac0 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -34,7 +34,6 @@ import android.content.pm.ResolveInfo; import android.database.Cursor; import android.graphics.Bitmap; import android.net.Uri; -import android.os.Build; import android.os.Environment; import android.os.Handler; import android.os.HandlerThread; diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java index 0599714057..3ce16c5a9b 100644 --- a/src/com/android/launcher3/LauncherProvider.java +++ b/src/com/android/launcher3/LauncherProvider.java @@ -1101,10 +1101,6 @@ public class LauncherProvider extends ContentProvider { = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLX); final int cellYIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY); - final int uriIndex - = c.getColumnIndexOrThrow(LauncherSettings.Favorites.URI); - final int displayModeIndex - = c.getColumnIndexOrThrow(LauncherSettings.Favorites.DISPLAY_MODE); final int profileIndex = c.getColumnIndex(LauncherSettings.Favorites.PROFILE_ID); @@ -1223,9 +1219,6 @@ public class LauncherProvider extends ContentProvider { c.getString(iconResourceIndex)); values.put(LauncherSettings.Favorites.ITEM_TYPE, itemType); values.put(LauncherSettings.Favorites.APPWIDGET_ID, -1); - values.put(LauncherSettings.Favorites.URI, c.getString(uriIndex)); - values.put(LauncherSettings.Favorites.DISPLAY_MODE, - c.getInt(displayModeIndex)); values.put(LauncherSettings.Favorites.PROFILE_ID, userSerialNumber); if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) { diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java index 157b48a397..20c27735e5 100644 --- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java +++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java @@ -18,12 +18,9 @@ package com.android.launcher3; import android.app.WallpaperManager; import android.content.Context; -import android.graphics.Canvas; -import android.graphics.Paint; import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; -import android.view.ViewGroup.LayoutParams; public class ShortcutAndWidgetContainer extends ViewGroup { static final String TAG = "CellLayoutChildren"; @@ -43,7 +40,6 @@ public class ShortcutAndWidgetContainer extends ViewGroup { private int mHeightGap; private int mCountX; - private int mCountY; private Launcher mLauncher; @@ -62,7 +58,6 @@ public class ShortcutAndWidgetContainer extends ViewGroup { mWidthGap = widthGap; mHeightGap = heightGap; mCountX = countX; - mCountY = countY; } public View getChildAt(int x, int y) { @@ -79,24 +74,6 @@ public class ShortcutAndWidgetContainer extends ViewGroup { return null; } - @Override - protected void dispatchDraw(Canvas canvas) { - @SuppressWarnings("all") // suppress dead code warning - final boolean debug = false; - if (debug) { - // Debug drawing for hit space - Paint p = new Paint(); - p.setColor(0x6600FF00); - for (int i = getChildCount() - 1; i >= 0; i--) { - final View child = getChildAt(i); - final CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams(); - - canvas.drawRect(lp.x, lp.y, lp.x + lp.width, lp.y + lp.height, p); - } - } - super.dispatchDraw(canvas); - } - @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int count = getChildCount(); @@ -238,7 +215,6 @@ public class ShortcutAndWidgetContainer extends ViewGroup { } } - @Override protected void setChildrenDrawnWithCacheEnabled(boolean enabled) { super.setChildrenDrawnWithCacheEnabled(enabled); } diff --git a/src/com/android/launcher3/StylusEventHelper.java b/src/com/android/launcher3/StylusEventHelper.java index da46e6a548..54c5509d90 100644 --- a/src/com/android/launcher3/StylusEventHelper.java +++ b/src/com/android/launcher3/StylusEventHelper.java @@ -1,8 +1,5 @@ package com.android.launcher3; -import com.android.launcher3.Utilities; - -import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java index f7c4489be2..affd32aff2 100644 --- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java +++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java @@ -317,7 +317,7 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter mSearchResults; private HashMap mCachedSectionNames = new HashMap<>(); - private RecyclerView.Adapter mAdapter; + private AllAppsGridAdapter mAdapter; private AlphabeticIndexCompat mIndexer; private AppNameComparator mAppNameComparator; private MergeAlgorithm mMergeAlgorithm; private int mNumAppsPerRow; private int mNumPredictedAppsPerRow; private int mNumAppRowsInAdapter; - private boolean mDisableEmptyText; public AlphabeticalAppsList(Context context) { mLauncher = (Launcher) context; @@ -212,17 +210,10 @@ public class AlphabeticalAppsList { /** * Sets the adapter to notify when this dataset changes. */ - public void setAdapter(RecyclerView.Adapter adapter) { + public void setAdapter(AllAppsGridAdapter adapter) { mAdapter = adapter; } - /** - * Disables the empty text message when there are no search results. - */ - public void disableEmptyText() { - mDisableEmptyText = true; - } - /** * Returns all the apps. */ diff --git a/src/com/android/launcher3/util/FocusLogic.java b/src/com/android/launcher3/util/FocusLogic.java index 696eabe002..1c6efbcf61 100644 --- a/src/com/android/launcher3/util/FocusLogic.java +++ b/src/com/android/launcher3/util/FocusLogic.java @@ -22,9 +22,6 @@ import android.view.View; import android.view.ViewGroup; import com.android.launcher3.CellLayout; -import com.android.launcher3.DeviceProfile; -import com.android.launcher3.Launcher; -import com.android.launcher3.LauncherAppState; import com.android.launcher3.ShortcutAndWidgetContainer; import java.util.Arrays; diff --git a/src/com/android/launcher3/widget/WidgetsListAdapter.java b/src/com/android/launcher3/widget/WidgetsListAdapter.java index a54626a391..8443003de6 100644 --- a/src/com/android/launcher3/widget/WidgetsListAdapter.java +++ b/src/com/android/launcher3/widget/WidgetsListAdapter.java @@ -27,7 +27,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; -import android.view.ViewGroup.MarginLayoutParams; import android.widget.LinearLayout; import com.android.launcher3.BubbleTextView; diff --git a/src/com/android/launcher3/widget/WidgetsRowViewHolder.java b/src/com/android/launcher3/widget/WidgetsRowViewHolder.java index 249559ab9f..19bc868a42 100644 --- a/src/com/android/launcher3/widget/WidgetsRowViewHolder.java +++ b/src/com/android/launcher3/widget/WidgetsRowViewHolder.java @@ -16,10 +16,7 @@ package com.android.launcher3.widget; import android.support.v7.widget.RecyclerView.ViewHolder; -import android.view.View; import android.view.ViewGroup; -import android.widget.ImageView; -import android.widget.TextView; public class WidgetsRowViewHolder extends ViewHolder {