summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-08-17 12:54:57 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-08-17 12:56:19 -0700
commit42e28092b336bf89bee94c61e2cd327e1d8ec882 (patch)
tree6752a35699e0781b0e3a8233f5171d2c5e6bcf2d /src/com/android
parente3e05563b755d3f94da6867049c1a81891545c88 (diff)
downloadandroid_packages_apps_Trebuchet-42e28092b336bf89bee94c61e2cd327e1d8ec882.tar.gz
android_packages_apps_Trebuchet-42e28092b336bf89bee94c61e2cd327e1d8ec882.tar.bz2
android_packages_apps_Trebuchet-42e28092b336bf89bee94c61e2cd327e1d8ec882.zip
Removing some eclipse warnings
Change-Id: I160feaee81b262be02446885fae643c0be71b7af
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher3/AppWidgetsRestoredReceiver.java1
-rw-r--r--src/com/android/launcher3/DeleteDropTarget.java1
-rw-r--r--src/com/android/launcher3/DragView.java12
-rw-r--r--src/com/android/launcher3/Hotseat.java2
-rw-r--r--src/com/android/launcher3/LauncherAppState.java1
-rw-r--r--src/com/android/launcher3/LauncherModel.java1
-rw-r--r--src/com/android/launcher3/LauncherProvider.java7
-rw-r--r--src/com/android/launcher3/ShortcutAndWidgetContainer.java24
-rw-r--r--src/com/android/launcher3/StylusEventHelper.java3
-rw-r--r--src/com/android/launcher3/allapps/AllAppsGridAdapter.java6
-rw-r--r--src/com/android/launcher3/allapps/AllAppsRecyclerView.java1
-rw-r--r--src/com/android/launcher3/allapps/AllAppsRecyclerViewContainerView.java4
-rw-r--r--src/com/android/launcher3/allapps/AllAppsSearchBarController.java1
-rw-r--r--src/com/android/launcher3/allapps/AlphabeticalAppsList.java13
-rw-r--r--src/com/android/launcher3/util/FocusLogic.java3
-rw-r--r--src/com/android/launcher3/widget/WidgetsListAdapter.java1
-rw-r--r--src/com/android/launcher3/widget/WidgetsRowViewHolder.java3
17 files changed, 9 insertions, 75 deletions
diff --git a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java
index b1d51ece0..10fdd8746 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 ae6e3ba0b..bf5bc178e 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 89577353b..c9dc9f1c6 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 17fdeb1dc..a9cff5e65 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 f2613875c..3ceca9417 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 03c87116c..b390f13ac 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 059971405..3ce16c5a9 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 157b48a39..20c27735e 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) {
@@ -80,24 +75,6 @@ public class ShortcutAndWidgetContainer extends ViewGroup {
}
@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 da46e6a54..54c5509d9 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 f7c4489be..affd32aff 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<AllAppsGridAdapter.
}
}
- private Launcher mLauncher;
+ @Thunk Launcher mLauncher;
private LayoutInflater mLayoutInflater;
@Thunk AlphabeticalAppsList mApps;
private GridLayoutManager mGridLayoutMgr;
@@ -340,9 +340,9 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
// each time the search query changes.
private String mMarketSearchMessage;
// The intent to send off to the market app, updated each time the search query changes.
- private Intent mMarketSearchIntent;
+ @Thunk Intent mMarketSearchIntent;
// The last query that the user entered into the search field
- private String mLastSearchQuery;
+ @Thunk String mLastSearchQuery;
// Section drawing
@Thunk int mSectionNamesMargin;
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index 5aa973a15..a46af5e09 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -27,7 +27,6 @@ import com.android.launcher3.BaseRecyclerView;
import com.android.launcher3.BaseRecyclerViewFastScrollBar;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Stats;
-import com.android.launcher3.Utilities;
import com.android.launcher3.util.Thunk;
import java.util.List;
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerViewContainerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerViewContainerView.java
index 14e2a1863..09a7d59bf 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerViewContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerViewContainerView.java
@@ -17,17 +17,15 @@ package com.android.launcher3.allapps;
import android.content.Context;
import android.graphics.Bitmap;
-import android.graphics.Canvas;
import android.util.AttributeSet;
-import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
+
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.BubbleTextView.BubbleTextShadowHandler;
import com.android.launcher3.ClickShadowView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
-import com.android.launcher3.R;
/**
* A container for RecyclerView to allow for the click shadow view to be shown behind an icon that
diff --git a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java
index 2b363c0cb..d853d5b8d 100644
--- a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java
+++ b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java
@@ -15,7 +15,6 @@
*/
package com.android.launcher3.allapps;
-import android.content.ComponentName;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index ffe39cdd3..cf53aa60e 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -16,7 +16,6 @@
package com.android.launcher3.allapps;
import android.content.Context;
-import android.support.v7.widget.RecyclerView;
import android.util.Log;
import com.android.launcher3.AppInfo;
@@ -182,14 +181,13 @@ public class AlphabeticalAppsList {
// The of ordered component names as a result of a search query
private ArrayList<ComponentKey> mSearchResults;
private HashMap<CharSequence, String> 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,18 +210,11 @@ 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.
*/
public List<AppInfo> getApps() {
diff --git a/src/com/android/launcher3/util/FocusLogic.java b/src/com/android/launcher3/util/FocusLogic.java
index 696eabe00..1c6efbcf6 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 a54626a39..8443003de 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 249559ab9..19bc868a4 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 {