Removing some eclipse warnings

Change-Id: I160feaee81b262be02446885fae643c0be71b7af
This commit is contained in:
Sunny Goyal
2015-08-17 12:56:19 -07:00
parent e3e05563b7
commit 42e28092b3
18 changed files with 10 additions and 77 deletions
@@ -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;
@@ -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;
@@ -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,
+3 -9
View File
@@ -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());
-2
View File
@@ -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;
@@ -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;
@@ -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;
@@ -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) {
@@ -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);
}
@@ -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;
@@ -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;
@@ -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;
@@ -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
@@ -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;
@@ -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,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.
*/
@@ -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;
@@ -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;
@@ -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 {