summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2012-08-29 11:53:10 +0800
committerOwen Lin <owenlin@google.com>2012-08-30 15:49:10 +0800
commit06961efbb7552d345a550708d8e40f0fb9345a9e (patch)
tree9fcea6debbee6add62d60314b03effcac6548446
parentb282374131b3f9b306968440550fca0dbe756ee0 (diff)
downloadandroid_packages_apps_Snap-06961efbb7552d345a550708d8e40f0fb9345a9e.tar.gz
android_packages_apps_Snap-06961efbb7552d345a550708d8e40f0fb9345a9e.tar.bz2
android_packages_apps_Snap-06961efbb7552d345a550708d8e40f0fb9345a9e.zip
Remove unused resources and fix some warnings.
Change-Id: I075977150c7da7650e723e29406f24ae2e23ea97
-rw-r--r--src/com/android/gallery3d/app/AlbumPage.java19
-rw-r--r--src/com/android/gallery3d/app/AlbumSetPage.java5
-rw-r--r--src/com/android/gallery3d/app/CropImage.java14
-rw-r--r--src/com/android/gallery3d/app/ManageCachePage.java13
-rw-r--r--src/com/android/gallery3d/app/MoviePlayer.java2
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java2
-rw-r--r--src/com/android/gallery3d/data/LocalAlbumSet.java5
-rw-r--r--src/com/android/gallery3d/data/MtpDevice.java2
-rw-r--r--src/com/android/gallery3d/data/MtpImage.java3
-rw-r--r--src/com/android/gallery3d/data/SizeClustering.java8
-rw-r--r--src/com/android/gallery3d/data/UriSource.java21
-rw-r--r--src/com/android/gallery3d/ui/MenuExecutor.java7
-rw-r--r--src/com/android/gallery3d/ui/Paper.java3
-rw-r--r--src/com/android/gallery3d/ui/PhotoView.java61
-rw-r--r--src/com/android/gallery3d/ui/PositionController.java4
-rw-r--r--src/com/android/gallery3d/util/GalleryUtils.java8
16 files changed, 86 insertions, 91 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java
index f1063925e..6c5c695cd 100644
--- a/src/com/android/gallery3d/app/AlbumPage.java
+++ b/src/com/android/gallery3d/app/AlbumPage.java
@@ -22,8 +22,6 @@ import android.content.Intent;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
import android.os.Vibrator;
import android.provider.MediaStore;
import android.widget.Toast;
@@ -45,7 +43,6 @@ import com.android.gallery3d.ui.ActionModeHandler.ActionModeListener;
import com.android.gallery3d.ui.AlbumSlotRenderer;
import com.android.gallery3d.ui.DetailsHelper;
import com.android.gallery3d.ui.DetailsHelper.CloseListener;
-import com.android.gallery3d.ui.FadeTexture;
import com.android.gallery3d.ui.GLCanvas;
import com.android.gallery3d.ui.GLRoot;
import com.android.gallery3d.ui.GLView;
@@ -55,7 +52,6 @@ import com.android.gallery3d.ui.RawTexture;
import com.android.gallery3d.ui.RelativePosition;
import com.android.gallery3d.ui.SelectionManager;
import com.android.gallery3d.ui.SlotView;
-import com.android.gallery3d.ui.SynchronizedHandler;
import com.android.gallery3d.util.Future;
import com.android.gallery3d.util.GalleryUtils;
import com.android.gallery3d.util.MediaSetUtils;
@@ -105,8 +101,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
private MediaSet mMediaSet;
private boolean mShowDetails;
private float mUserDistance; // in pixel
- private Handler mHandler;
-
private Future<Integer> mSyncTask = null;
private int mLoadingBits = 0;
@@ -385,19 +379,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
mSlotView.startScatteringAnimation(mOpenCenter);
}
}
-
- mHandler = new SynchronizedHandler(mActivity.getGLRoot()) {
- @Override
- public void handleMessage(Message message) {
- switch (message.what) {
- case MSG_PICK_PHOTO: {
- pickPhoto(message.arg1);
- break;
- }
- default: throw new AssertionError(message.what);
- }
- }
- };
}
@Override
diff --git a/src/com/android/gallery3d/app/AlbumSetPage.java b/src/com/android/gallery3d/app/AlbumSetPage.java
index c7046be7d..c34e83ef8 100644
--- a/src/com/android/gallery3d/app/AlbumSetPage.java
+++ b/src/com/android/gallery3d/app/AlbumSetPage.java
@@ -20,9 +20,8 @@ import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
+import android.content.Intent;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Handler;
@@ -312,7 +311,7 @@ public class AlbumSetPage extends ActivityState implements
R.string.empty_album, Toast.LENGTH_LONG).show();
mActivity.getStateManager().finishState(this);
} else {
- emptyGalleryPrompt((Activity) mActivity);
+ emptyGalleryPrompt(mActivity);
}
} else if (mEmptyGalleryPrompt != null) {
mEmptyGalleryPrompt = null;
diff --git a/src/com/android/gallery3d/app/CropImage.java b/src/com/android/gallery3d/app/CropImage.java
index c9621496a..ea2cba36d 100644
--- a/src/com/android/gallery3d/app/CropImage.java
+++ b/src/com/android/gallery3d/app/CropImage.java
@@ -496,19 +496,23 @@ public class CropImage extends AbstractGalleryActivity {
}
});
try {
- bitmap.compress(format, DEFAULT_COMPRESS_QUALITY, os);
+ bitmap.compress(format, DEFAULT_COMPRESS_QUALITY, ios);
return !jc.isCancelled();
} finally {
jc.setCancelListener(null);
- Utils.closeSilently(os);
+ Utils.closeSilently(ios);
}
}
private boolean saveBitmapToUri(JobContext jc, Bitmap bitmap, Uri uri) {
try {
- return saveBitmapToOutputStream(jc, bitmap,
- convertExtensionToCompressFormat(getFileExtension()),
- getContentResolver().openOutputStream(uri));
+ OutputStream out = getContentResolver().openOutputStream(uri);
+ try {
+ return saveBitmapToOutputStream(jc, bitmap,
+ convertExtensionToCompressFormat(getFileExtension()), out);
+ } finally {
+ Utils.closeSilently(out);
+ }
} catch (FileNotFoundException e) {
Log.w(TAG, "cannot write output", e);
}
diff --git a/src/com/android/gallery3d/app/ManageCachePage.java b/src/com/android/gallery3d/app/ManageCachePage.java
index 8f95112f3..37a97626e 100644
--- a/src/com/android/gallery3d/app/ManageCachePage.java
+++ b/src/com/android/gallery3d/app/ManageCachePage.java
@@ -112,11 +112,10 @@ public class ManageCachePage extends ActivityState implements
mLayoutReady = false;
mEyePosition.resetPosition();
- Activity activity = (Activity) mActivity;
int slotViewTop = mActivity.getGalleryActionBar().getHeight();
int slotViewBottom = bottom - top;
- View footer = activity.findViewById(R.id.footer);
+ View footer = mActivity.findViewById(R.id.footer);
if (footer != null) {
int location[] = {0, 0};
footer.getLocationOnScreen(location);
@@ -284,7 +283,7 @@ public class ManageCachePage extends ActivityState implements
}
private void initializeViews() {
- Activity activity = (Activity) mActivity;
+ Activity activity = mActivity;
mSelectionManager = new SelectionManager(mActivity, true);
mSelectionManager.setSelectionListener(this);
@@ -315,7 +314,7 @@ public class ManageCachePage extends ActivityState implements
}
private void initializeFooterViews() {
- Activity activity = (Activity) mActivity;
+ Activity activity = mActivity;
LayoutInflater inflater = activity.getLayoutInflater();
mFooterContent = inflater.inflate(R.layout.manage_offline_bar, null);
@@ -347,7 +346,7 @@ public class ManageCachePage extends ActivityState implements
private void showToast() {
if (mAlbumCountToMakeAvailableOffline > 0) {
- Activity activity = (Activity) mActivity;
+ Activity activity = mActivity;
Toast.makeText(activity, activity.getResources().getQuantityString(
R.plurals.make_albums_available_offline,
mAlbumCountToMakeAvailableOffline),
@@ -356,7 +355,7 @@ public class ManageCachePage extends ActivityState implements
}
private void showToastForLocalAlbum() {
- Activity activity = (Activity) mActivity;
+ Activity activity = mActivity;
Toast.makeText(activity, activity.getResources().getString(
R.string.try_to_set_local_album_available_offline),
Toast.LENGTH_SHORT).show();
@@ -371,7 +370,7 @@ public class ManageCachePage extends ActivityState implements
long expectedBytes = mCacheStorageInfo.getExpectedUsedBytes();
long freeBytes = mCacheStorageInfo.getFreeBytes();
- Activity activity = (Activity) mActivity;
+ Activity activity = mActivity;
if (totalBytes == 0) {
progressBar.setProgress(0);
progressBar.setSecondaryProgress(0);
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index f2dc9ad20..0cf361c71 100644
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -217,6 +217,7 @@ public class MoviePlayer implements
});
}
+ @SuppressWarnings("deprecation")
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void showSystemUi(boolean visible) {
if (!ApiHelper.HAS_VIEW_SYSTEM_UI_FLAG_LAYOUT_STABLE) return;
@@ -225,6 +226,7 @@ public class MoviePlayer implements
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
if (!visible) {
+ // We used the deprecated "STATUS_BAR_HIDDEN" for unbundling
flag |= View.STATUS_BAR_HIDDEN | View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
}
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index d101aac7b..3354c919d 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -147,8 +147,6 @@ public class PhotoPage extends ActivityState implements
private NfcAdapter mNfcAdapter;
- private Menu mActionBarMenu;
-
private final MyMenuVisibilityListener mMenuVisibilityListener =
new MyMenuVisibilityListener();
diff --git a/src/com/android/gallery3d/data/LocalAlbumSet.java b/src/com/android/gallery3d/data/LocalAlbumSet.java
index 5d01c064a..d737ca803 100644
--- a/src/com/android/gallery3d/data/LocalAlbumSet.java
+++ b/src/com/android/gallery3d/data/LocalAlbumSet.java
@@ -37,12 +37,13 @@ import java.util.Comparator;
// The path should be "/local/image", "local/video" or "/local/all"
public class LocalAlbumSet extends MediaSet
implements FutureListener<ArrayList<MediaSet>> {
+ @SuppressWarnings("unused")
+ private static final String TAG = "LocalAlbumSet";
+
public static final Path PATH_ALL = Path.fromString("/local/all");
public static final Path PATH_IMAGE = Path.fromString("/local/image");
public static final Path PATH_VIDEO = Path.fromString("/local/video");
- private static final String TAG = "LocalAlbumSet";
-
private static final Uri[] mWatchUris =
{Images.Media.EXTERNAL_CONTENT_URI, Video.Media.EXTERNAL_CONTENT_URI};
diff --git a/src/com/android/gallery3d/data/MtpDevice.java b/src/com/android/gallery3d/data/MtpDevice.java
index b233b3cf0..999f55420 100644
--- a/src/com/android/gallery3d/data/MtpDevice.java
+++ b/src/com/android/gallery3d/data/MtpDevice.java
@@ -37,7 +37,6 @@ public class MtpDevice extends MediaSet {
private final GalleryApp mApplication;
private final int mDeviceId;
private final String mDeviceName;
- private final DataManager mDataManager;
private final MtpContext mMtpContext;
private final String mName;
private final ChangeNotifier mNotifier;
@@ -50,7 +49,6 @@ public class MtpDevice extends MediaSet {
mApplication = application;
mDeviceId = deviceId;
mDeviceName = UsbDevice.getDeviceName(deviceId);
- mDataManager = application.getDataManager();
mMtpContext = mtpContext;
mName = name;
mNotifier = new ChangeNotifier(this, Uri.parse("mtp://"), application);
diff --git a/src/com/android/gallery3d/data/MtpImage.java b/src/com/android/gallery3d/data/MtpImage.java
index 801a1d244..0abb1985d 100644
--- a/src/com/android/gallery3d/data/MtpImage.java
+++ b/src/com/android/gallery3d/data/MtpImage.java
@@ -28,7 +28,6 @@ import android.util.Log;
import com.android.gallery3d.app.GalleryApp;
import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.provider.GalleryProvider;
-import com.android.gallery3d.util.ThreadPool;
import com.android.gallery3d.util.ThreadPool.Job;
import com.android.gallery3d.util.ThreadPool.JobContext;
@@ -44,7 +43,6 @@ public class MtpImage extends MediaItem {
private int mObjectSize;
private long mDateTaken;
private String mFileName;
- private final ThreadPool mThreadPool;
private final MtpContext mMtpContext;
private final MtpObjectInfo mObjInfo;
private final int mImageWidth;
@@ -63,7 +61,6 @@ public class MtpImage extends MediaItem {
mFileName = objInfo.getName();
mImageWidth = objInfo.getImagePixWidth();
mImageHeight = objInfo.getImagePixHeight();
- mThreadPool = application.getThreadPool();
mMtpContext = mtpContext;
}
diff --git a/src/com/android/gallery3d/data/SizeClustering.java b/src/com/android/gallery3d/data/SizeClustering.java
index 0bde55e9e..b809c841b 100644
--- a/src/com/android/gallery3d/data/SizeClustering.java
+++ b/src/com/android/gallery3d/data/SizeClustering.java
@@ -24,6 +24,7 @@ import com.android.gallery3d.R;
import java.util.ArrayList;
public class SizeClustering extends Clustering {
+ @SuppressWarnings("unused")
private static final String TAG = "SizeClustering";
private Context mContext;
@@ -48,10 +49,11 @@ public class SizeClustering extends Clustering {
mContext = context;
}
+ @SuppressWarnings("unchecked")
@Override
public void run(MediaSet baseSet) {
- final ArrayList<Path>[] group =
- (ArrayList<Path>[]) new ArrayList[SIZE_LEVELS.length];
+ @SuppressWarnings("unchecked")
+ final ArrayList<Path>[] group = new ArrayList[SIZE_LEVELS.length];
baseSet.enumerateTotalMediaItems(new MediaSet.ItemConsumer() {
@Override
public void consume(int index, MediaItem item) {
@@ -80,7 +82,7 @@ public class SizeClustering extends Clustering {
}
}
- mClusters = (ArrayList<Path>[]) new ArrayList[count];
+ mClusters = new ArrayList[count];
mNames = new String[count];
mMinSizes = new long[count];
diff --git a/src/com/android/gallery3d/data/UriSource.java b/src/com/android/gallery3d/data/UriSource.java
index d37c51d13..f66bacd7b 100644
--- a/src/com/android/gallery3d/data/UriSource.java
+++ b/src/com/android/gallery3d/data/UriSource.java
@@ -22,6 +22,7 @@ import android.webkit.MimeTypeMap;
import com.android.gallery3d.app.GalleryApp;
+import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
@@ -30,6 +31,7 @@ class UriSource extends MediaSource {
private static final String TAG = "UriSource";
private static final String IMAGE_TYPE_PREFIX = "image/";
private static final String IMAGE_TYPE_ANY = "image/*";
+ private static final String CHARSET_UTF_8 = "utf-8";
private GalleryApp mApplication;
@@ -44,9 +46,13 @@ class UriSource extends MediaSource {
if (segment.length != 3) {
throw new RuntimeException("bad path: " + path);
}
- String uri = URLDecoder.decode(segment[1]);
- String type = URLDecoder.decode(segment[2]);
- return new UriImage(mApplication, path, Uri.parse(uri), type);
+ try {
+ String uri = URLDecoder.decode(segment[1], CHARSET_UTF_8);
+ String type = URLDecoder.decode(segment[2], CHARSET_UTF_8);
+ return new UriImage(mApplication, path, Uri.parse(uri), type);
+ } catch (UnsupportedEncodingException e) {
+ throw new AssertionError(e);
+ }
}
private String getMimeType(Uri uri) {
@@ -75,8 +81,13 @@ class UriSource extends MediaSource {
}
if (type.startsWith(IMAGE_TYPE_PREFIX)) {
- return Path.fromString("/uri/" + URLEncoder.encode(uri.toString())
- + "/" +URLEncoder.encode(type));
+ try {
+ return Path.fromString("/uri/"
+ + URLEncoder.encode(uri.toString(), CHARSET_UTF_8)
+ + "/" +URLEncoder.encode(type, CHARSET_UTF_8));
+ } catch (UnsupportedEncodingException e) {
+ throw new AssertionError(e);
+ }
}
// We have no clues that it is an image
return null;
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index 691056294..5e76fe6ad 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -61,7 +61,6 @@ public class MenuExecutor {
private Future<?> mTask;
// wait the operation to finish when we want to stop it.
private boolean mWaitOnStop;
- private Intent mShareIntent;
private final AbstractGalleryActivity mActivity;
private final SelectionManager mSelectionManager;
@@ -230,7 +229,7 @@ public class MenuExecutor {
Intent intent = getIntentBySingleSelectedPath(Intent.ACTION_ATTACH_DATA)
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra("mimeType", intent.getType());
- Activity activity = (Activity) mActivity;
+ Activity activity = mActivity;
activity.startActivity(Intent.createChooser(
intent, activity.getString(R.string.set_as)));
return;
@@ -314,7 +313,7 @@ public class MenuExecutor {
ArrayList<Path> ids = mSelectionManager.getSelected(false);
stopTaskAndDismissDialog();
- Activity activity = (Activity) mActivity;
+ Activity activity = mActivity;
mDialog = createProgressDialog(activity, title, ids.size());
if (showDialog) {
mDialog.show();
@@ -366,7 +365,7 @@ public class MenuExecutor {
double latlng[] = new double[2];
item.getLatLong(latlng);
if (GalleryUtils.isValidLocation(latlng[0], latlng[1])) {
- GalleryUtils.showOnMap((Context) mActivity, latlng[0], latlng[1]);
+ GalleryUtils.showOnMap(mActivity, latlng[0], latlng[1]);
}
break;
}
diff --git a/src/com/android/gallery3d/ui/Paper.java b/src/com/android/gallery3d/ui/Paper.java
index 3bd0a2175..b36f5c3a2 100644
--- a/src/com/android/gallery3d/ui/Paper.java
+++ b/src/com/android/gallery3d/ui/Paper.java
@@ -30,7 +30,7 @@ class Paper {
private static final int ROTATE_FACTOR = 4;
private EdgeAnimation mAnimationLeft = new EdgeAnimation();
private EdgeAnimation mAnimationRight = new EdgeAnimation();
- private int mWidth, mHeight;
+ private int mWidth;
private float[] mMatrix = new float[16];
public void overScroll(float distance) {
@@ -63,7 +63,6 @@ class Paper {
public void setSize(int width, int height) {
mWidth = width;
- mHeight = height;
}
public float[] getTransform(Rect rect, float scrollX) {
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java
index 5c4c1e970..9a0fe9d09 100644
--- a/src/com/android/gallery3d/ui/PhotoView.java
+++ b/src/com/android/gallery3d/ui/PhotoView.java
@@ -19,7 +19,6 @@ package com.android.gallery3d.ui;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Matrix;
-import android.graphics.Point;
import android.graphics.Rect;
import android.os.Build;
import android.os.Message;
@@ -189,7 +188,6 @@ public class PhotoView extends GLView {
private Listener mListener;
private Model mModel;
- private StringTexture mLoadingText;
private StringTexture mNoThumbnailText;
private TileImageView mTileView;
private EdgeView mEdgeView;
@@ -198,7 +196,6 @@ public class PhotoView extends GLView {
private SynchronizedHandler mHandler;
- private Point mImageCenter = new Point();
private boolean mCancelExtraScalingPending;
private boolean mFilmMode = false;
private int mDisplayRotation = 0;
@@ -252,9 +249,6 @@ public class PhotoView extends GLView {
hideUndoBar();
}
});
- mLoadingText = StringTexture.newInstance(
- context.getString(R.string.loading),
- DEFAULT_TEXT_SIZE, Color.WHITE);
mNoThumbnailText = StringTexture.newInstance(
context.getString(R.string.no_thumbnail),
DEFAULT_TEXT_SIZE, Color.WHITE);
@@ -266,25 +260,37 @@ public class PhotoView extends GLView {
mPositionController = new PositionController(context,
new PositionController.Listener() {
- public void invalidate() {
- PhotoView.this.invalidate();
- }
- public boolean isHoldingDown() {
- return (mHolding & HOLD_TOUCH_DOWN) != 0;
- }
- public boolean isHoldingDelete() {
- return (mHolding & HOLD_DELETE) != 0;
- }
- public void onPull(int offset, int direction) {
- mEdgeView.onPull(offset, direction);
- }
- public void onRelease() {
- mEdgeView.onRelease();
- }
- public void onAbsorb(int velocity, int direction) {
- mEdgeView.onAbsorb(velocity, direction);
- }
- });
+
+ @Override
+ public void invalidate() {
+ PhotoView.this.invalidate();
+ }
+
+ @Override
+ public boolean isHoldingDown() {
+ return (mHolding & HOLD_TOUCH_DOWN) != 0;
+ }
+
+ @Override
+ public boolean isHoldingDelete() {
+ return (mHolding & HOLD_DELETE) != 0;
+ }
+
+ @Override
+ public void onPull(int offset, int direction) {
+ mEdgeView.onPull(offset, direction);
+ }
+
+ @Override
+ public void onRelease() {
+ mEdgeView.onRelease();
+ }
+
+ @Override
+ public void onAbsorb(int velocity, int direction) {
+ mEdgeView.onAbsorb(velocity, direction);
+ }
+ });
mVideoPlayIcon = new ResourceTexture(context, R.drawable.ic_control_play);
for (int i = -SCREEN_NAIL_MAX; i <= SCREEN_NAIL_MAX; i++) {
if (i == 0) {
@@ -369,7 +375,7 @@ public class PhotoView extends GLView {
default: throw new AssertionError(message.what);
}
}
- };
+ }
////////////////////////////////////////////////////////////////////////////
// Data/Image change notifications
@@ -559,9 +565,6 @@ public class PhotoView extends GLView {
private int mLoadingState = Model.LOADING_INIT;
private Size mSize = new Size();
private boolean mWasCameraCenter;
- public void FullPicture(TileImageView tileView) {
- mTileView = tileView;
- }
@Override
public void reload() {
diff --git a/src/com/android/gallery3d/ui/PositionController.java b/src/com/android/gallery3d/ui/PositionController.java
index 16e9f7ba1..434054df0 100644
--- a/src/com/android/gallery3d/ui/PositionController.java
+++ b/src/com/android/gallery3d/ui/PositionController.java
@@ -23,10 +23,10 @@ import android.util.Log;
import com.android.gallery3d.app.PhotoPage;
import com.android.gallery3d.common.OverScroller;
import com.android.gallery3d.common.Utils;
+import com.android.gallery3d.ui.PhotoView.Size;
import com.android.gallery3d.util.GalleryUtils;
import com.android.gallery3d.util.RangeArray;
import com.android.gallery3d.util.RangeIntArray;
-import com.android.gallery3d.ui.PhotoView.Size;
class PositionController {
private static final String TAG = "PositionController";
@@ -857,6 +857,7 @@ class PositionController {
//dumpState();
}
+ @SuppressWarnings("unused")
private void dumpState() {
for (int i = -BOX_MAX; i < BOX_MAX; i++) {
Log.d(TAG, "Gap " + i + ": " + mGaps.get(i).mCurrentGap);
@@ -981,6 +982,7 @@ class PositionController {
g.mAnimationStartTime = NO_ANIMATION;
}
+ @SuppressWarnings("unused")
private void debugMoveBox(int fromIndex[]) {
StringBuilder s = new StringBuilder("moveBox:");
for (int i = 0; i < fromIndex.length; i++) {
diff --git a/src/com/android/gallery3d/util/GalleryUtils.java b/src/com/android/gallery3d/util/GalleryUtils.java
index e750e2769..f04a5ccff 100644
--- a/src/com/android/gallery3d/util/GalleryUtils.java
+++ b/src/com/android/gallery3d/util/GalleryUtils.java
@@ -86,10 +86,10 @@ public class GalleryUtils {
public static float[] intColorToFloatARGBArray(int from) {
return new float[] {
- (float) Color.alpha(from) / 255f,
- (float) Color.red(from) / 255f,
- (float) Color.green(from) / 255f,
- (float) Color.blue(from) / 255f
+ Color.alpha(from) / 255f,
+ Color.red(from) / 255f,
+ Color.green(from) / 255f,
+ Color.blue(from) / 255f
};
}