summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2011-11-07 18:36:31 +0800
committerAngus Kong <shkong@google.com>2011-11-07 18:36:31 +0800
commit219f0da6a5dec8dc20dff909fcb0bf549b6a1219 (patch)
treee954ee3ad4c8a5205a318645505f2b65074db5c5 /src/com
parent781528e1c86aa16d72694510898325d65e32c35b (diff)
downloadLegacyCamera-219f0da6a5dec8dc20dff909fcb0bf549b6a1219.zip
LegacyCamera-219f0da6a5dec8dc20dff909fcb0bf549b6a1219.tar.gz
LegacyCamera-219f0da6a5dec8dc20dff909fcb0bf549b6a1219.tar.bz2
Make dialog rotatable in Video mode.
bug:5575805 Change-Id: I6776f2b1d5a174a95ab40f8480110f0a34fb41e0
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/MenuHelper.java20
-rwxr-xr-xsrc/com/android/camera/VideoCamera.java10
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() {