diff options
author | Owen Lin <owenlin@google.com> | 2009-07-01 17:03:33 -0700 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2009-07-06 13:36:49 -0700 |
commit | 52aae7063493140ef91e1067c5100d9b52a48287 (patch) | |
tree | 5c79b294349bc75bd826a436fe78423bbc072b93 /src/com | |
parent | 91acfc99279d5ece7ac9cb2d7a2980eb0d3b50da (diff) | |
download | LegacyCamera-52aae7063493140ef91e1067c5100d9b52a48287.zip LegacyCamera-52aae7063493140ef91e1067c5100d9b52a48287.tar.gz LegacyCamera-52aae7063493140ef91e1067c5100d9b52a48287.tar.bz2 |
Fix some warning shown in Eclipse.
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/Camera.java | 74 | ||||
-rw-r--r-- | src/com/android/camera/DeleteImage.java | 6 | ||||
-rw-r--r-- | src/com/android/camera/ImageGallery.java | 10 | ||||
-rw-r--r-- | src/com/android/camera/gallery/Cancelable.java | 1 | ||||
-rw-r--r-- | src/com/android/camera/gallery/Image.java | 12 | ||||
-rw-r--r-- | src/com/android/camera/gallery/ImageListUber.java | 6 |
6 files changed, 11 insertions, 98 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 92a394b..cbbc9b1 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -71,7 +71,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; -import java.util.StringTokenizer; /** * Activity of the Camera which used to see preview and take pictures. @@ -107,11 +106,8 @@ public class Camera extends Activity implements View.OnClickListener, public static final int MENU_SAVE_CAMERA_VIDEO_DONE = 37; private android.hardware.Camera.Parameters mParameters; - private int mZoomIndex = 0; // The index of the current zoom value. - private String[] mZoomValues; // All possible zoom values. // The parameter strings to communicate with camera driver. - public static final String PARM_ZOOM = "zoom"; public static final String PARM_PICTURE_SIZE = "picture-size"; public static final String PARM_JPEG_QUALITY = "jpeg-quality"; public static final String PARM_ROTATION = "rotation"; @@ -331,76 +327,11 @@ public class Camera extends Activity implements View.OnClickListener, } } - private void initializeZoom() { - String zoomValuesStr = mParameters.get(SUPPORTED_ZOOM); - if (zoomValuesStr == null) return; - - mZoomValues = getZoomValues(zoomValuesStr); - if (mZoomValues == null) return; - - mZoomButtons = new ZoomButtonsController(mSurfaceView); - mZoomButtons.setAutoDismissed(true); - mZoomButtons.setOnZoomListener( - new ZoomButtonsController.OnZoomListener() { - public void onVisibilityChanged(boolean visible) { - if (visible) { - updateZoomButtonsEnabled(); - } - } - - public void onZoom(boolean zoomIn) { - if (zoomIn) { - zoomIn(); - } else { - zoomOut(); - } - updateZoomButtonsEnabled(); - } - }); - } - - private void zoomIn() { - if (mZoomIndex < mZoomValues.length - 1) { - mZoomIndex++; - mParameters.set(PARM_ZOOM, mZoomValues[mZoomIndex]); - mCameraDevice.setParameters(mParameters); - } - } - - private void zoomOut() { - if (mZoomIndex > 0) { - mZoomIndex--; - mParameters.set(PARM_ZOOM, mZoomValues[mZoomIndex]); - mCameraDevice.setParameters(mParameters); - } - } - - private void updateZoomButtonsEnabled() { - mZoomButtons.setZoomInEnabled(mZoomIndex < mZoomValues.length - 1); - mZoomButtons.setZoomOutEnabled(mZoomIndex > 0); - } - - private String[] getZoomValues(String zoomValuesStr) { - ArrayList<String> list = new ArrayList<String>(); - String[] zoomValues = null; - StringTokenizer tokenizer = new StringTokenizer(zoomValuesStr, ","); - - while (tokenizer.hasMoreElements()) { - list.add(tokenizer.nextToken()); - } - if (list.size() > 0) { - zoomValues = list.toArray(new String[list.size()]); - } - return zoomValues; - } - - LocationListener [] mLocationListeners = new LocationListener[] { new LocationListener(LocationManager.GPS_PROVIDER), new LocationListener(LocationManager.NETWORK_PROVIDER) }; - private final BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -1470,11 +1401,6 @@ public class Camera extends Activity implements View.OnClickListener, getString(R.string.pref_camera_jpegquality_default)); mParameters.set(PARM_JPEG_QUALITY, jpegQuality); - // Set zoom. - if (mZoomValues != null) { - mParameters.set(PARM_ZOOM, mZoomValues[mZoomIndex]); - } - mCameraDevice.setParameters(mParameters); } diff --git a/src/com/android/camera/DeleteImage.java b/src/com/android/camera/DeleteImage.java index 94f291b..3a13466 100644 --- a/src/com/android/camera/DeleteImage.java +++ b/src/com/android/camera/DeleteImage.java @@ -27,12 +27,14 @@ import android.widget.ProgressBar; import java.util.ArrayList; public class DeleteImage extends Activity { + + @SuppressWarnings("unused") private static final String TAG = "DeleteImage"; private ProgressBar mProgressBar; private ArrayList<Uri> mUriList; // a list of image uri private int mIndex = 0; // next image to delete - private Handler mHandler = new Handler(); - private Runnable mDeleteNextRunnable = new Runnable() { + private final Handler mHandler = new Handler(); + private final Runnable mDeleteNextRunnable = new Runnable() { public void run() { deleteNext(); } diff --git a/src/com/android/camera/ImageGallery.java b/src/com/android/camera/ImageGallery.java index 6576d6e..4f23ecd 100644 --- a/src/com/android/camera/ImageGallery.java +++ b/src/com/android/camera/ImageGallery.java @@ -16,7 +16,6 @@ package com.android.camera; -import com.android.camera.gallery.Cancelable; import com.android.camera.gallery.IImage; import com.android.camera.gallery.IImageList; import com.android.camera.gallery.VideoObject; @@ -94,8 +93,6 @@ public class ImageGallery extends Activity implements private Uri mCropResultUri; - private final PriorityTaskQueue mPriorityQueue = new PriorityTaskQueue(1); - // The index of the first picture in GridViewSpecial. private int mSelectedIndex = GridViewSpecial.SELECT_NONE; private float mScrollPosition = INVALID_POSITION; @@ -984,13 +981,6 @@ public class ImageGallery extends Activity implements MenuHelper.deleteMultiple(this, action); } - private <T> void postBackgroundTask(String message, Cancelable<T> task) { - String title = getResources().getString(R.string.progress_dialog_title); - PriorityTask<T> pTask = PriorityTask.wrap(task); - Util.showProgressDialog(this, title, message, pTask); - mPriorityQueue.add(pTask); - } - private boolean isInMultiSelectMode() { return mMultiSelected != null; } diff --git a/src/com/android/camera/gallery/Cancelable.java b/src/com/android/camera/gallery/Cancelable.java index 802891c..e648922 100644 --- a/src/com/android/camera/gallery/Cancelable.java +++ b/src/com/android/camera/gallery/Cancelable.java @@ -47,7 +47,6 @@ public interface Cancelable<T> { /** * Gets the results of this <code>Cancelable</code> task. * - * @throws CancellationException if the task has been cancelled * @throws ExecutionException if exception is thrown during the execution of * the task */ diff --git a/src/com/android/camera/gallery/Image.java b/src/com/android/camera/gallery/Image.java index 189f29a..cb4c90b 100644 --- a/src/com/android/camera/gallery/Image.java +++ b/src/com/android/camera/gallery/Image.java @@ -16,10 +16,6 @@ package com.android.camera.gallery; -import com.android.camera.BitmapManager; -import com.android.camera.ExifInterface; -import com.android.camera.Util; - import android.content.ContentResolver; import android.content.ContentUris; import android.content.ContentValues; @@ -33,6 +29,10 @@ import android.provider.MediaStore.Images.ImageColumns; import android.provider.MediaStore.Images.Thumbnails; import android.util.Log; +import com.android.camera.BitmapManager; +import com.android.camera.ExifInterface; +import com.android.camera.Util; + import java.io.FileNotFoundException; import java.io.IOException; import java.util.HashMap; @@ -166,15 +166,11 @@ public class Image extends BaseImage implements IImage { private class SaveImageContentsCancelable extends BaseCancelable<Void> { private final Bitmap mImage; private final byte [] mJpegData; - private final int mOrientation; - private final String mFilePath; SaveImageContentsCancelable(Bitmap image, byte[] jpegData, int orientation, String filePath) { mImage = image; mJpegData = jpegData; - mOrientation = orientation; - mFilePath = filePath; } @Override diff --git a/src/com/android/camera/gallery/ImageListUber.java b/src/com/android/camera/gallery/ImageListUber.java index 6d032a9..4a433dd 100644 --- a/src/com/android/camera/gallery/ImageListUber.java +++ b/src/com/android/camera/gallery/ImageListUber.java @@ -16,14 +16,14 @@ package com.android.camera.gallery; -import com.android.camera.ImageManager; -import com.android.camera.Util; - import android.content.ContentResolver; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; +import com.android.camera.ImageManager; +import com.android.camera.Util; + import java.io.IOException; import java.util.Arrays; import java.util.Comparator; |