diff options
-rw-r--r-- | src/com/android/camera/MenuHelper.java | 20 | ||||
-rwxr-xr-x | src/com/android/camera/VideoCamera.java | 10 |
2 files changed, 7 insertions, 23 deletions
diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java index 07caeb2..576e9c4 100644 --- a/src/com/android/camera/MenuHelper.java +++ b/src/com/android/camera/MenuHelper.java @@ -47,26 +47,6 @@ public class MenuHelper { private static final String PANORAMA_CLASS = "com.android.camera.panorama.PanoramaActivity"; private static final String VIDEO_CAMERA_CLASS = "com.android.camera.VideoCamera"; - public static void confirmAction(Context context, String title, - String message, final Runnable action) { - OnClickListener listener = new OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - switch (which) { - case DialogInterface.BUTTON_POSITIVE: - if (action != null) action.run(); - } - } - }; - new AlertDialog.Builder(context) - .setIconAttribute(android.R.attr.alertDialogIcon) - .setTitle(title) - .setMessage(message) - .setPositiveButton(android.R.string.ok, listener) - .setNegativeButton(android.R.string.cancel, listener) - .create() - .show(); - } - public static void addSwitchModeMenuItem(Menu menu, int mode, final Runnable r) { int labelId, iconId; diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 0b946c4..75cba44 100755 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -151,6 +151,7 @@ public class VideoCamera extends ActivityBase private int mSurfaceWidth; private int mSurfaceHeight; private View mReviewControl; + private RotateDialogController mRotateDialog; private Toast mNoShareToast; // An review image having same size as preview. It is displayed when @@ -418,6 +419,8 @@ public class VideoCamera extends ActivityBase mModePicker.setOnModeChangeListener(this); } + mRotateDialog = new RotateDialogController(this, R.layout.rotate_dialog); + mPreviewPanel = findViewById(R.id.frame_layout); mPreviewFrameLayout = (PreviewFrameLayout) findViewById(R.id.frame); mReviewImage = (ImageView) findViewById(R.id.review_image); @@ -569,7 +572,7 @@ public class VideoCamera extends ActivityBase private void setOrientationIndicator(int orientation) { Rotatable[] indicators = {mThumbnailView, mModePicker, mSharePopup, mBgLearningMessageRotater, mIndicatorControlContainer, - mReviewDoneButton, mReviewPlayButton, mReviewCancelButton}; + mReviewDoneButton, mReviewPlayButton, mReviewCancelButton, mRotateDialog}; for (Rotatable indicator : indicators) { if (indicator != null) indicator.setOrientation(orientation); } @@ -2048,10 +2051,11 @@ public class VideoCamera extends ActivityBase restorePreferences(); } }; - MenuHelper.confirmAction(this, + mRotateDialog.showAlertDialog( getString(R.string.confirm_restore_title), getString(R.string.confirm_restore_message), - runnable); + getString(android.R.string.ok), runnable, + getString(android.R.string.cancel), null); } private void restorePreferences() { |