diff options
author | Ray Chen <> | 2009-03-24 20:37:45 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-24 20:37:45 -0700 |
commit | 7638a541959f3f371b9998844a0bbef2df4aa3ee (patch) | |
tree | 57b87ba3d6b4555fbc11841bde2a0a0ac9e1c394 /src | |
parent | 66e144311dcc35620990bd5d0ec6528b75a840c4 (diff) | |
download | LegacyCamera-7638a541959f3f371b9998844a0bbef2df4aa3ee.zip LegacyCamera-7638a541959f3f371b9998844a0bbef2df4aa3ee.tar.gz LegacyCamera-7638a541959f3f371b9998844a0bbef2df4aa3ee.tar.bz2 |
Automated import from //branches/donutburger/...@141603,141603
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/MenuHelper.java | 12 | ||||
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 7 | ||||
-rw-r--r-- | src/com/android/camera/ViewImage.java | 6 |
3 files changed, 17 insertions, 8 deletions
diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java index 27b057b..ed5803c 100644 --- a/src/com/android/camera/MenuHelper.java +++ b/src/com/android/camera/MenuHelper.java @@ -266,7 +266,7 @@ public class MenuHelper { requiresWriteAccessItems.add(deleteItem); deleteItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { - deleteImageImpl(activity, onDelete, isImage); + deleteImpl(activity, onDelete, isImage); return true; } }) @@ -485,16 +485,20 @@ public class MenuHelper { } static void deletePhoto(Activity activity, Runnable onDelete) { - deleteImageImpl(activity, onDelete, true); + deleteImpl(activity, onDelete, true); + } + + static void deleteVideo(Activity activity, Runnable onDelete) { + deleteImpl(activity, onDelete, false); } static void deleteImage(Activity activity, Runnable onDelete, IImage image) { if (image != null) { - deleteImageImpl(activity, onDelete, ImageManager.isImage(image)); + deleteImpl(activity, onDelete, ImageManager.isImage(image)); } } - private static void deleteImageImpl(Activity activity, final Runnable onDelete, boolean isPhoto) { + private static void deleteImpl(Activity activity, final Runnable onDelete, boolean isPhoto) { boolean confirm = android.preference.PreferenceManager.getDefaultSharedPreferences(activity).getBoolean("pref_gallery_confirm_delete_key", true); if (!confirm) { if (onDelete != null) diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 7f1b010..776755f 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -327,7 +327,12 @@ public class VideoCamera extends Activity implements View.OnClickListener, break; case R.id.discard: { - discardCurrentVideoAndStartPreview(); + Runnable deleteCallback = new Runnable() { + public void run() { + discardCurrentVideoAndStartPreview(); + } + }; + MenuHelper.deleteVideo(this, deleteCallback); break; } diff --git a/src/com/android/camera/ViewImage.java b/src/com/android/camera/ViewImage.java index 1376172..b8379d2 100644 --- a/src/com/android/camera/ViewImage.java +++ b/src/com/android/camera/ViewImage.java @@ -394,8 +394,8 @@ public class ViewImage extends Activity implements View.OnClickListener return true; } case KeyEvent.KEYCODE_DEL: - MenuHelper.displayDeleteDialog(mViewImage, - mViewImage.mDeletePhotoRunnable, true); + MenuHelper.deletePhoto( + mViewImage, mViewImage.mDeletePhotoRunnable); break; } } finally { @@ -1482,7 +1482,7 @@ public class ViewImage extends Activity implements View.OnClickListener break; case R.id.discard: { - MenuHelper.displayDeleteDialog(this, mDeletePhotoRunnable, true); + MenuHelper.deletePhoto(this, mDeletePhotoRunnable); } break; |