summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui
diff options
context:
space:
mode:
authorAhbong Chang <cwahbong@google.com>2012-07-30 11:34:13 +0800
committerAhbong Chang <cwahbong@google.com>2012-07-30 11:42:01 +0800
commit813ac7496e93faa2cf0f2763df421a146d38fc11 (patch)
treef4a1064166c83f8560cdf5eaeb18a4107fd344a5 /src/com/android/gallery3d/ui
parentdbc472eb08c19e78811823f8b83e59c3aeacc6d0 (diff)
downloadandroid_packages_apps_Snap-813ac7496e93faa2cf0f2763df421a146d38fc11.tar.gz
android_packages_apps_Snap-813ac7496e93faa2cf0f2763df421a146d38fc11.tar.bz2
android_packages_apps_Snap-813ac7496e93faa2cf0f2763df421a146d38fc11.zip
Code clean up.
Remove unused imports. Remove unused fields. Remove unnecessary cast. Add missing override annotations. Change-Id: Idad2e587697a5015eb5363d7b71fab9de9cc8ffb
Diffstat (limited to 'src/com/android/gallery3d/ui')
-rw-r--r--src/com/android/gallery3d/ui/ActionModeHandler.java7
-rw-r--r--src/com/android/gallery3d/ui/BasicTexture.java4
-rw-r--r--src/com/android/gallery3d/ui/BitmapScreenNail.java1
-rw-r--r--src/com/android/gallery3d/ui/CacheStorageUsageInfo.java1
-rw-r--r--src/com/android/gallery3d/ui/ColorTexture.java5
-rw-r--r--src/com/android/gallery3d/ui/CropView.java1
-rw-r--r--src/com/android/gallery3d/ui/DetailsAddressResolver.java3
-rw-r--r--src/com/android/gallery3d/ui/DialogDetailsView.java11
-rw-r--r--src/com/android/gallery3d/ui/EdgeEffect.java1
-rw-r--r--src/com/android/gallery3d/ui/EdgeView.java1
-rw-r--r--src/com/android/gallery3d/ui/ExtTexture.java1
-rw-r--r--src/com/android/gallery3d/ui/FlingScroller.java1
-rw-r--r--src/com/android/gallery3d/ui/GLCanvasImpl.java26
-rw-r--r--src/com/android/gallery3d/ui/GalleryEGLConfigChooser.java1
-rw-r--r--src/com/android/gallery3d/ui/GestureRecognizer.java1
-rw-r--r--src/com/android/gallery3d/ui/MenuExecutor.java1
-rw-r--r--src/com/android/gallery3d/ui/Paper.java2
-rw-r--r--src/com/android/gallery3d/ui/PhotoView.java7
-rw-r--r--src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java2
-rw-r--r--src/com/android/gallery3d/ui/UndoBarView.java22
-rw-r--r--src/com/android/gallery3d/ui/UploadedTexture.java1
21 files changed, 85 insertions, 15 deletions
diff --git a/src/com/android/gallery3d/ui/ActionModeHandler.java b/src/com/android/gallery3d/ui/ActionModeHandler.java
index 80d2500d4..0b5cd54cd 100644
--- a/src/com/android/gallery3d/ui/ActionModeHandler.java
+++ b/src/com/android/gallery3d/ui/ActionModeHandler.java
@@ -51,6 +51,7 @@ import java.util.ArrayList;
public class ActionModeHandler implements
ActionMode.Callback, PopupList.OnPopupItemClickListener {
+ @SuppressWarnings("unused")
private static final String TAG = "ActionModeHandler";
private static final int SUPPORT_MULTIPLE_MASK = MediaObject.SUPPORT_DELETE
| MediaObject.SUPPORT_ROTATE | MediaObject.SUPPORT_SHARE
@@ -161,12 +162,14 @@ public class ActionModeHandler implements
mSelectionMenu.updateSelectAllMode(mSelectionManager.inSelectAllMode());
}
+ @Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
MenuInflater inflater = mode.getMenuInflater();
inflater.inflate(R.menu.operation, menu);
mShareActionProvider = GalleryActionBar.initializeShareActionProvider(menu);
OnShareTargetSelectedListener listener = new OnShareTargetSelectedListener() {
+ @Override
public boolean onShareTargetSelected(ShareActionProvider source, Intent intent) {
mSelectionManager.leaveSelectionMode();
return false;
@@ -178,10 +181,12 @@ public class ActionModeHandler implements
return true;
}
+ @Override
public void onDestroyActionMode(ActionMode mode) {
mSelectionManager.leaveSelectionMode();
}
+ @Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
return true;
}
@@ -291,6 +296,7 @@ public class ActionModeHandler implements
// Generate sharing intent and update supported operations in the background
// The task can take a long time and be canceled in the mean time.
mMenuTask = mActivity.getThreadPool().submit(new Job<Void>() {
+ @Override
public Void run(final JobContext jc) {
// Pass1: Deal with unexpanded media object list for menu operation.
final int operation = computeMenuOptions(jc);
@@ -298,6 +304,7 @@ public class ActionModeHandler implements
// Pass2: Deal with expanded media object list for sharing operation.
final Intent intent = supportShare ? computeSharingIntent(jc) : null;
mMainHandler.post(new Runnable() {
+ @Override
public void run() {
mMenuTask = null;
if (!jc.isCancelled()) {
diff --git a/src/com/android/gallery3d/ui/BasicTexture.java b/src/com/android/gallery3d/ui/BasicTexture.java
index 78559270f..784b499ca 100644
--- a/src/com/android/gallery3d/ui/BasicTexture.java
+++ b/src/com/android/gallery3d/ui/BasicTexture.java
@@ -87,10 +87,12 @@ abstract class BasicTexture implements Texture {
return mId;
}
+ @Override
public int getWidth() {
return mWidth;
}
+ @Override
public int getHeight() {
return mHeight;
}
@@ -124,10 +126,12 @@ abstract class BasicTexture implements Texture {
mHasBorder = hasBorder;
}
+ @Override
public void draw(GLCanvas canvas, int x, int y) {
canvas.drawTexture(this, x, y, getWidth(), getHeight());
}
+ @Override
public void draw(GLCanvas canvas, int x, int y, int w, int h) {
canvas.drawTexture(this, x, y, w, h);
}
diff --git a/src/com/android/gallery3d/ui/BitmapScreenNail.java b/src/com/android/gallery3d/ui/BitmapScreenNail.java
index 0043e0cbe..6cb36b092 100644
--- a/src/com/android/gallery3d/ui/BitmapScreenNail.java
+++ b/src/com/android/gallery3d/ui/BitmapScreenNail.java
@@ -31,6 +31,7 @@ import com.android.gallery3d.data.MediaItem;
// - When the the bitmap is available, and we have drawn the placeholder color
// before, we will do a fade-in animation.
public class BitmapScreenNail implements ScreenNail {
+ @SuppressWarnings("unused")
private static final String TAG = "BitmapScreenNail";
private static final int PLACEHOLDER_COLOR = 0xFF222222;
// The duration of the fading animation in milliseconds
diff --git a/src/com/android/gallery3d/ui/CacheStorageUsageInfo.java b/src/com/android/gallery3d/ui/CacheStorageUsageInfo.java
index c65d77eff..611648a29 100644
--- a/src/com/android/gallery3d/ui/CacheStorageUsageInfo.java
+++ b/src/com/android/gallery3d/ui/CacheStorageUsageInfo.java
@@ -25,6 +25,7 @@ import com.android.gallery3d.util.ThreadPool.JobContext;
import java.io.File;
public class CacheStorageUsageInfo {
+ @SuppressWarnings("unused")
private static final String TAG = "CacheStorageUsageInfo";
// number of bytes the storage has.
diff --git a/src/com/android/gallery3d/ui/ColorTexture.java b/src/com/android/gallery3d/ui/ColorTexture.java
index 24e8914b5..733c05653 100644
--- a/src/com/android/gallery3d/ui/ColorTexture.java
+++ b/src/com/android/gallery3d/ui/ColorTexture.java
@@ -31,14 +31,17 @@ public class ColorTexture implements Texture {
mHeight = 1;
}
+ @Override
public void draw(GLCanvas canvas, int x, int y) {
draw(canvas, x, y, mWidth, mHeight);
}
+ @Override
public void draw(GLCanvas canvas, int x, int y, int w, int h) {
canvas.fillRect(x, y, w, h, mColor);
}
+ @Override
public boolean isOpaque() {
return Utils.isOpaque(mColor);
}
@@ -48,10 +51,12 @@ public class ColorTexture implements Texture {
mHeight = height;
}
+ @Override
public int getWidth() {
return mWidth;
}
+ @Override
public int getHeight() {
return mHeight;
}
diff --git a/src/com/android/gallery3d/ui/CropView.java b/src/com/android/gallery3d/ui/CropView.java
index 78d5d373d..8c2c3df2a 100644
--- a/src/com/android/gallery3d/ui/CropView.java
+++ b/src/com/android/gallery3d/ui/CropView.java
@@ -44,6 +44,7 @@ import javax.microedition.khronos.opengles.GL11;
* The activity can crop specific region of interest from an image.
*/
public class CropView extends GLView {
+ @SuppressWarnings("unused")
private static final String TAG = "CropView";
private static final int FACE_PIXEL_COUNT = 120000; // around 400x300
diff --git a/src/com/android/gallery3d/ui/DetailsAddressResolver.java b/src/com/android/gallery3d/ui/DetailsAddressResolver.java
index f5439234d..3dd20a5e0 100644
--- a/src/com/android/gallery3d/ui/DetailsAddressResolver.java
+++ b/src/com/android/gallery3d/ui/DetailsAddressResolver.java
@@ -43,6 +43,7 @@ public class DetailsAddressResolver {
mLatlng = latlng;
}
+ @Override
public Address run(JobContext jc) {
ReverseGeocoder geocoder = new ReverseGeocoder(mContext.getAndroidContext());
return geocoder.lookupAddress(mLatlng[0], mLatlng[1], true);
@@ -63,10 +64,12 @@ public class DetailsAddressResolver {
mAddressLookupJob = mContext.getThreadPool().submit(
new AddressLookupJob(latlng),
new FutureListener<Address>() {
+ @Override
public void onFutureDone(final Future<Address> future) {
mAddressLookupJob = null;
if (!future.isCancelled()) {
mHandler.post(new Runnable() {
+ @Override
public void run() {
updateLocation(future.get());
}
diff --git a/src/com/android/gallery3d/ui/DialogDetailsView.java b/src/com/android/gallery3d/ui/DialogDetailsView.java
index c90ab4033..a55660035 100644
--- a/src/com/android/gallery3d/ui/DialogDetailsView.java
+++ b/src/com/android/gallery3d/ui/DialogDetailsView.java
@@ -59,15 +59,18 @@ public class DialogDetailsView implements DetailsViewContainer {
mSource = source;
}
+ @Override
public void show() {
reloadDetails();
mDialog.show();
}
+ @Override
public void hide() {
mDialog.hide();
}
+ @Override
public void reloadDetails() {
int index = mSource.setIndex();
if (index == -1) return;
@@ -92,6 +95,7 @@ public class DialogDetailsView implements DetailsViewContainer {
.setView(detailsList)
.setTitle(title)
.setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {
+ @Override
public void onClick(DialogInterface dialog, int whichButton) {
mDialog.dismiss();
}
@@ -99,6 +103,7 @@ public class DialogDetailsView implements DetailsViewContainer {
.create();
mDialog.setOnDismissListener(new OnDismissListener() {
+ @Override
public void onDismiss(DialogInterface dialog) {
if (mListener != null) {
mListener.onClose();
@@ -198,18 +203,22 @@ public class DialogDetailsView implements DetailsViewContainer {
return false;
}
+ @Override
public int getCount() {
return mItems.size();
}
+ @Override
public Object getItem(int position) {
return mDetails.getDetail(position);
}
+ @Override
public long getItemId(int position) {
return position;
}
+ @Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView tv;
if (convertView == null) {
@@ -222,12 +231,14 @@ public class DialogDetailsView implements DetailsViewContainer {
return tv;
}
+ @Override
public void onAddressAvailable(String address) {
mItems.set(mLocationIndex, address);
notifyDataSetChanged();
}
}
+ @Override
public void setCloseListener(CloseListener listener) {
mListener = listener;
}
diff --git a/src/com/android/gallery3d/ui/EdgeEffect.java b/src/com/android/gallery3d/ui/EdgeEffect.java
index 362b8fea6..ed369737b 100644
--- a/src/com/android/gallery3d/ui/EdgeEffect.java
+++ b/src/com/android/gallery3d/ui/EdgeEffect.java
@@ -51,6 +51,7 @@ import com.android.gallery3d.R;
* {@link #draw(Canvas)} method.</p>
*/
public class EdgeEffect {
+ @SuppressWarnings("unused")
private static final String TAG = "EdgeEffect";
// Time it will take the effect to fully recede in ms
diff --git a/src/com/android/gallery3d/ui/EdgeView.java b/src/com/android/gallery3d/ui/EdgeView.java
index bf97108a8..4aff0494d 100644
--- a/src/com/android/gallery3d/ui/EdgeView.java
+++ b/src/com/android/gallery3d/ui/EdgeView.java
@@ -21,6 +21,7 @@ import android.opengl.Matrix;
// EdgeView draws EdgeEffect (blue glow) at four sides of the view.
public class EdgeView extends GLView {
+ @SuppressWarnings("unused")
private static final String TAG = "EdgeView";
public static final int INVALID_DIRECTION = -1;
diff --git a/src/com/android/gallery3d/ui/ExtTexture.java b/src/com/android/gallery3d/ui/ExtTexture.java
index 9319d8ccd..eac504fe5 100644
--- a/src/com/android/gallery3d/ui/ExtTexture.java
+++ b/src/com/android/gallery3d/ui/ExtTexture.java
@@ -77,6 +77,7 @@ public class ExtTexture extends BasicTexture {
return mTarget;
}
+ @Override
public boolean isOpaque() {
return true;
}
diff --git a/src/com/android/gallery3d/ui/FlingScroller.java b/src/com/android/gallery3d/ui/FlingScroller.java
index 1cddcdb76..6f98c64f9 100644
--- a/src/com/android/gallery3d/ui/FlingScroller.java
+++ b/src/com/android/gallery3d/ui/FlingScroller.java
@@ -26,6 +26,7 @@ package com.android.gallery3d.ui;
// (2) The duration is different.
// (3) The deceleration curve is different.
class FlingScroller {
+ @SuppressWarnings("unused")
private static final String TAG = "FlingController";
// The fling duration (in milliseconds) when velocity is 1 pixel/second
diff --git a/src/com/android/gallery3d/ui/GLCanvasImpl.java b/src/com/android/gallery3d/ui/GLCanvasImpl.java
index 45ea0584f..7b7a31773 100644
--- a/src/com/android/gallery3d/ui/GLCanvasImpl.java
+++ b/src/com/android/gallery3d/ui/GLCanvasImpl.java
@@ -92,6 +92,7 @@ public class GLCanvasImpl implements GLCanvas {
initialize();
}
+ @Override
public void setSize(int width, int height) {
Utils.assertTrue(width >= 0 && height >= 0);
@@ -119,15 +120,18 @@ public class GLCanvasImpl implements GLCanvas {
}
}
+ @Override
public void setAlpha(float alpha) {
Utils.assertTrue(alpha >= 0 && alpha <= 1);
mAlpha = alpha;
}
+ @Override
public float getAlpha() {
return mAlpha;
}
+ @Override
public void multiplyAlpha(float alpha) {
Utils.assertTrue(alpha >= 0 && alpha <= 1);
mAlpha *= alpha;
@@ -166,6 +170,7 @@ public class GLCanvasImpl implements GLCanvas {
// mMatrixValues and mAlpha will be initialized in setSize()
}
+ @Override
public void drawRect(float x, float y, float width, float height, GLPaint paint) {
GL11 gl = mGL;
@@ -183,6 +188,7 @@ public class GLCanvasImpl implements GLCanvas {
mCountDrawLine++;
}
+ @Override
public void drawLine(float x1, float y1, float x2, float y2, GLPaint paint) {
GL11 gl = mGL;
@@ -200,6 +206,7 @@ public class GLCanvasImpl implements GLCanvas {
mCountDrawLine++;
}
+ @Override
public void fillRect(float x, float y, float width, float height, int color) {
mGLState.setColorMode(color, mAlpha);
GL11 gl = mGL;
@@ -215,6 +222,7 @@ public class GLCanvasImpl implements GLCanvas {
mCountFillRect++;
}
+ @Override
public void translate(float x, float y, float z) {
Matrix.translateM(mMatrixValues, 0, x, y, z);
}
@@ -222,6 +230,7 @@ public class GLCanvasImpl implements GLCanvas {
// This is a faster version of translate(x, y, z) because
// (1) we knows z = 0, (2) we inline the Matrix.translateM call,
// (3) we unroll the loop
+ @Override
public void translate(float x, float y) {
float[] m = mMatrixValues;
m[12] += m[0] * x + m[4] * y;
@@ -230,10 +239,12 @@ public class GLCanvasImpl implements GLCanvas {
m[15] += m[3] * x + m[7] * y;
}
+ @Override
public void scale(float sx, float sy, float sz) {
Matrix.scaleM(mMatrixValues, 0, sx, sy, sz);
}
+ @Override
public void rotate(float angle, float x, float y, float z) {
if (angle == 0) return;
float[] temp = mTempMatrix;
@@ -242,6 +253,7 @@ public class GLCanvasImpl implements GLCanvas {
System.arraycopy(temp, 16, mMatrixValues, 0, 16);
}
+ @Override
public void multiplyMatrix(float matrix[], int offset) {
float[] temp = mTempMatrix;
Matrix.multiplyMM(temp, 0, mMatrixValues, 0, matrix, offset);
@@ -262,6 +274,7 @@ public class GLCanvasImpl implements GLCanvas {
mCountTextureRect++;
}
+ @Override
public void drawMesh(BasicTexture tex, int x, int y, int xyBuffer,
int uvBuffer, int indexBuffer, int indexCount) {
float alpha = mAlpha;
@@ -352,6 +365,7 @@ public class GLCanvasImpl implements GLCanvas {
}
}
+ @Override
public void drawTexture(
BasicTexture texture, int x, int y, int width, int height) {
drawTexture(texture, x, y, width, height, mAlpha);
@@ -368,6 +382,7 @@ public class GLCanvasImpl implements GLCanvas {
drawBoundTexture(texture, x, y, width, height);
}
+ @Override
public void drawTexture(BasicTexture texture, RectF source, RectF target) {
if (target.width() <= 0 || target.height() <= 0) return;
@@ -386,6 +401,7 @@ public class GLCanvasImpl implements GLCanvas {
textureRect(target.left, target.top, target.width(), target.height());
}
+ @Override
public void drawTexture(BasicTexture texture, float[] mTextureTransform,
int x, int y, int w, int h) {
mGLState.setBlendEnabled(mBlendEnabled
@@ -427,6 +443,7 @@ public class GLCanvasImpl implements GLCanvas {
}
}
+ @Override
public void drawMixed(BasicTexture from,
int toColor, float ratio, int x, int y, int w, int h) {
drawMixed(from, toColor, ratio, x, y, w, h, mAlpha);
@@ -626,10 +643,12 @@ public class GLCanvasImpl implements GLCanvas {
}
}
+ @Override
public GL11 getGLInstance() {
return mGL;
}
+ @Override
public void clearBuffer() {
mGL.glClear(GL10.GL_COLOR_BUFFER_BIT);
}
@@ -659,6 +678,7 @@ public class GLCanvasImpl implements GLCanvas {
// unloadTexture and deleteBuffer can be called from the finalizer thread,
// so we synchronized on the mUnboundTextures object.
+ @Override
public boolean unloadTexture(BasicTexture t) {
synchronized (mUnboundTextures) {
if (!t.isLoaded()) return false;
@@ -667,12 +687,14 @@ public class GLCanvasImpl implements GLCanvas {
}
}
+ @Override
public void deleteBuffer(int bufferId) {
synchronized (mUnboundTextures) {
mDeleteBuffers.add(bufferId);
}
}
+ @Override
public void deleteRecycledResources() {
synchronized (mUnboundTextures) {
IntArray ids = mUnboundTextures;
@@ -689,10 +711,12 @@ public class GLCanvasImpl implements GLCanvas {
}
}
+ @Override
public void save() {
save(SAVE_FLAG_ALL);
}
+ @Override
public void save(int saveFlags) {
ConfigState config = obtainRestoreConfig();
@@ -712,6 +736,7 @@ public class GLCanvasImpl implements GLCanvas {
mRestoreStack.add(config);
}
+ @Override
public void restore() {
if (mRestoreStack.isEmpty()) throw new IllegalStateException();
ConfigState config = mRestoreStack.remove(mRestoreStack.size() - 1);
@@ -746,6 +771,7 @@ public class GLCanvasImpl implements GLCanvas {
}
}
+ @Override
public void dumpStatisticsAndClear() {
String line = String.format(
"MESH:%d, TEX_OES:%d, TEX_RECT:%d, FILL_RECT:%d, LINE:%d",
diff --git a/src/com/android/gallery3d/ui/GalleryEGLConfigChooser.java b/src/com/android/gallery3d/ui/GalleryEGLConfigChooser.java
index 0d5643ff9..7089d3c1d 100644
--- a/src/com/android/gallery3d/ui/GalleryEGLConfigChooser.java
+++ b/src/com/android/gallery3d/ui/GalleryEGLConfigChooser.java
@@ -39,6 +39,7 @@ class GalleryEGLConfigChooser implements EGLConfigChooser {
EGL10.EGL_NONE
};
+ @Override
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
int[] numConfig = new int[1];
if (!egl.eglChooseConfig(display, mConfigSpec, null, 0, numConfig)) {
diff --git a/src/com/android/gallery3d/ui/GestureRecognizer.java b/src/com/android/gallery3d/ui/GestureRecognizer.java
index 780c548d0..e4e0c49f5 100644
--- a/src/com/android/gallery3d/ui/GestureRecognizer.java
+++ b/src/com/android/gallery3d/ui/GestureRecognizer.java
@@ -25,6 +25,7 @@ import android.view.ScaleGestureDetector;
// This class aggregates three gesture detectors: GestureDetector,
// ScaleGestureDetector, and DownUpDetector.
public class GestureRecognizer {
+ @SuppressWarnings("unused")
private static final String TAG = "GestureRecognizer";
public interface Listener {
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index 3619ca0f6..aaf5d3974 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -380,6 +380,7 @@ public class MenuExecutor {
mListener = listener;
}
+ @Override
public Void run(JobContext jc) {
int index = 0;
DataManager manager = mActivity.getDataManager();
diff --git a/src/com/android/gallery3d/ui/Paper.java b/src/com/android/gallery3d/ui/Paper.java
index 3b67a049a..3bd0a2175 100644
--- a/src/com/android/gallery3d/ui/Paper.java
+++ b/src/com/android/gallery3d/ui/Paper.java
@@ -25,6 +25,7 @@ import com.android.gallery3d.common.Utils;
// This class does the overscroll effect.
class Paper {
+ @SuppressWarnings("unused")
private static final String TAG = "Paper";
private static final int ROTATE_FACTOR = 4;
private EdgeAnimation mAnimationLeft = new EdgeAnimation();
@@ -90,6 +91,7 @@ class Paper {
// This class follows the structure of frameworks's EdgeEffect class.
class EdgeAnimation {
+ @SuppressWarnings("unused")
private static final String TAG = "EdgeAnimation";
private static final int STATE_IDLE = 0;
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java
index 25254338a..ec042da23 100644
--- a/src/com/android/gallery3d/ui/PhotoView.java
+++ b/src/com/android/gallery3d/ui/PhotoView.java
@@ -539,7 +539,7 @@ public class PhotoView extends GLView {
boolean isDeletable(); // whether the picture can be deleted
void forceSize(); // called when mCompensation changes
Size getSize();
- };
+ }
class FullPicture implements Picture {
private int mRotation;
@@ -1046,9 +1046,8 @@ public class PhotoView extends GLView {
|| !mTouchBoxDeletable) {
return false;
}
- int maxVelocity = (int) GalleryUtils.dpToPixel(MAX_DISMISS_VELOCITY);
- int escapeVelocity =
- (int) GalleryUtils.dpToPixel(SWIPE_ESCAPE_VELOCITY);
+ int maxVelocity = GalleryUtils.dpToPixel(MAX_DISMISS_VELOCITY);
+ int escapeVelocity = GalleryUtils.dpToPixel(SWIPE_ESCAPE_VELOCITY);
int centerY = mPositionController.getPosition(mTouchBoxIndex)
.centerY();
boolean fastEnough = (Math.abs(vy) > escapeVelocity)
diff --git a/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java b/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java
index dd9b7ce1f..fd16b3537 100644
--- a/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java
+++ b/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java
@@ -19,12 +19,12 @@ package com.android.gallery3d.ui;
import android.annotation.TargetApi;
import android.graphics.RectF;
import android.graphics.SurfaceTexture;
-import android.opengl.GLES11Ext;
import com.android.gallery3d.common.ApiHelper;
public abstract class SurfaceTextureScreenNail implements ScreenNail,
SurfaceTexture.OnFrameAvailableListener {
+ @SuppressWarnings("unused")
private static final String TAG = "SurfaceTextureScreenNail";
// This constant is not available in API level before 15, but it was just an
// oversight.
diff --git a/src/com/android/gallery3d/ui/UndoBarView.java b/src/com/android/gallery3d/ui/UndoBarView.java
index f5ea5d1ad..8c9836deb 100644
--- a/src/com/android/gallery3d/ui/UndoBarView.java
+++ b/src/com/android/gallery3d/ui/UndoBarView.java
@@ -24,6 +24,7 @@ import com.android.gallery3d.common.Utils;
import com.android.gallery3d.util.GalleryUtils;
public class UndoBarView extends GLView {
+ @SuppressWarnings("unused")
private static final String TAG = "UndoBarView";
private static final int WHITE = 0xFFFFFFFF;
@@ -55,16 +56,16 @@ public class UndoBarView extends GLView {
// +-+----+----------------+-+--+----+-+------+--+-+
// 4 16 1 12 32 8 16 4
public UndoBarView(Context context) {
- mBarHeight = (int) GalleryUtils.dpToPixel(48);
- mBarMargin = (int) GalleryUtils.dpToPixel(4);
- mUndoTextMargin = (int) GalleryUtils.dpToPixel(16);
- mIconMargin = (int) GalleryUtils.dpToPixel(8);
- mIconSize = (int) GalleryUtils.dpToPixel(32);
- mSeparatorRightMargin = (int) GalleryUtils.dpToPixel(12);
- mSeparatorTopMargin = (int) GalleryUtils.dpToPixel(10);
- mSeparatorBottomMargin = (int) GalleryUtils.dpToPixel(10);
- mSeparatorWidth = (int) GalleryUtils.dpToPixel(1);
- mDeletedTextMargin = (int) GalleryUtils.dpToPixel(16);
+ mBarHeight = GalleryUtils.dpToPixel(48);
+ mBarMargin = GalleryUtils.dpToPixel(4);
+ mUndoTextMargin = GalleryUtils.dpToPixel(16);
+ mIconMargin = GalleryUtils.dpToPixel(8);
+ mIconSize = GalleryUtils.dpToPixel(32);
+ mSeparatorRightMargin = GalleryUtils.dpToPixel(12);
+ mSeparatorTopMargin = GalleryUtils.dpToPixel(10);
+ mSeparatorBottomMargin = GalleryUtils.dpToPixel(10);
+ mSeparatorWidth = GalleryUtils.dpToPixel(1);
+ mDeletedTextMargin = GalleryUtils.dpToPixel(16);
mPanel = new NinePatchTexture(context, R.drawable.panel_undo_holo);
mUndoText = StringTexture.newInstance(context.getString(R.string.undo),
@@ -166,6 +167,7 @@ public class UndoBarView extends GLView {
return (visibility == VISIBLE) ? 1f : 0f;
}
+ @Override
public void setVisibility(int visibility) {
mAlpha = getTargetAlpha(visibility);
mAnimationStartTime = NO_ANIMATION;
diff --git a/src/com/android/gallery3d/ui/UploadedTexture.java b/src/com/android/gallery3d/ui/UploadedTexture.java
index 0fe506735..bb86d05ef 100644
--- a/src/com/android/gallery3d/ui/UploadedTexture.java
+++ b/src/com/android/gallery3d/ui/UploadedTexture.java
@@ -318,6 +318,7 @@ abstract class UploadedTexture extends BasicTexture {
mOpaque = isOpaque;
}
+ @Override
public boolean isOpaque() {
return mOpaque;
}