diff options
author | likaid <likaid@codeaurora.org> | 2015-03-11 16:46:42 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-03-26 15:11:25 -0700 |
commit | 82d71e41c466f2e3b8370ffdd97aa84bfc9c4ce9 (patch) | |
tree | 4c45d49eae4b8bfb094abdd51a8454aa9e63d885 /src/com/android/camera/WideAnglePanoramaUI.java | |
parent | d343fc2bef002a3ceb4c3414fdac57c4bae11c59 (diff) | |
download | android_packages_apps_Snap-82d71e41c466f2e3b8370ffdd97aa84bfc9c4ce9.tar.gz android_packages_apps_Snap-82d71e41c466f2e3b8370ffdd97aa84bfc9c4ce9.tar.bz2 android_packages_apps_Snap-82d71e41c466f2e3b8370ffdd97aa84bfc9c4ce9.zip |
SnapdragonCamera: The alert dialog's rotation is not right
It will pop up a alert dialog if something goes wrong while
generating mosaic. The alert dialog's rotation is not right,
as a result, the alert dialog's UI will gose wrong.
Use RotateLayout to set the rotation before we show the alert.
Change-Id: Iaa91e811393a90c9f28f98404d782d2cc2ad9fe9
CRs-Fixed: 805471
Diffstat (limited to 'src/com/android/camera/WideAnglePanoramaUI.java')
-rw-r--r-- | src/com/android/camera/WideAnglePanoramaUI.java | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java index 230c31c86..862e4d2ba 100644 --- a/src/com/android/camera/WideAnglePanoramaUI.java +++ b/src/com/android/camera/WideAnglePanoramaUI.java @@ -41,6 +41,7 @@ import android.view.TextureView; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; +import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; @@ -103,6 +104,8 @@ public class WideAnglePanoramaUI implements private int mOrientation; private int mPreviewYOffset; private RotateLayout mWaitingDialog; + private RotateLayout mPanoFailedDialog; + private Button mPanoFailedButton; /** Constructor. */ public WideAnglePanoramaUI( @@ -462,6 +465,8 @@ public class WideAnglePanoramaUI implements setPanoramaPreviewView(); mWaitingDialog = (RotateLayout) mRootView.findViewById(R.id.waitingDialog); + mPanoFailedDialog = (RotateLayout) mRootView.findViewById(R.id.pano_dialog_layout); + mPanoFailedButton = (Button) mRootView.findViewById(R.id.pano_dialog_button1); mDialogHelper = new DialogHelper(); setViews(appRes); } @@ -536,16 +541,13 @@ public class WideAnglePanoramaUI implements } private class DialogHelper { - private AlertDialog mAlertDialog; DialogHelper() { - mAlertDialog = null; } public void dismissAll() { - if (mAlertDialog != null) { - mAlertDialog.dismiss(); - mAlertDialog = null; + if (mPanoFailedDialog != null) { + mPanoFailedDialog.setVisibility(View.INVISIBLE); } if (mWaitingDialog != null) { mWaitingDialog.setVisibility(View.INVISIBLE); @@ -556,16 +558,14 @@ public class WideAnglePanoramaUI implements CharSequence title, CharSequence message, CharSequence buttonMessage, final Runnable buttonRunnable) { dismissAll(); - mAlertDialog = (new AlertDialog.Builder(mActivity)) - .setTitle(title) - .setMessage(message) - .setNeutralButton(buttonMessage, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - buttonRunnable.run(); - } - }) - .show(); + mPanoFailedButton.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + buttonRunnable.run(); + mPanoFailedDialog.setVisibility(View.INVISIBLE); + } + }); + mPanoFailedDialog.setVisibility(View.VISIBLE); } public void showWaitingDialog(CharSequence message) { @@ -684,6 +684,7 @@ public class WideAnglePanoramaUI implements lp.gravity = g; button.setLayoutParams(lp); mWaitingDialog.setRotation(-orientation); + mPanoFailedDialog.setRotation(-orientation); mReview.setRotation(-orientation); mTooFastPrompt.setRotation(-orientation); mCameraControls.setOrientation(orientation, animation); |