summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-03-29 02:09:43 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-03-29 02:09:43 -0700
commit69f0e6845e92f6c1e6424cf19e45e69545bd0072 (patch)
tree553a2f587bd247673e4bc986733573abaa4b5df9
parent86eaf8459f23f564579e29f9ad0335f8cb15ca29 (diff)
parent82d71e41c466f2e3b8370ffdd97aa84bfc9c4ce9 (diff)
downloadandroid_packages_apps_Snap-69f0e6845e92f6c1e6424cf19e45e69545bd0072.zip
android_packages_apps_Snap-69f0e6845e92f6c1e6424cf19e45e69545bd0072.tar.gz
android_packages_apps_Snap-69f0e6845e92f6c1e6424cf19e45e69545bd0072.tar.bz2
Merge "SnapdragonCamera: The alert dialog's rotation is not right"
-rw-r--r--res/layout/panorama_module.xml73
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java31
2 files changed, 89 insertions, 15 deletions
diff --git a/res/layout/panorama_module.xml b/res/layout/panorama_module.xml
index db05b80..5ae3002 100644
--- a/res/layout/panorama_module.xml
+++ b/res/layout/panorama_module.xml
@@ -55,6 +55,79 @@
</com.android.camera.ui.RotateLayout>
<include layout="@layout/pano_module_review" />
+
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_dialog_layout"
+ android:gravity="center"
+ android:layout_gravity="center"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" >
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_gravity="center"
+ android:background="@color/popup_background"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <LinearLayout android:id="@+id/pano_dialog_title_layout"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView android:id="@+id/pano_dialog_title"
+ style="@style/TextAppearance.DialogWindowTitle"
+ android:gravity="center_vertical"
+ android:layout_marginLeft="16dip"
+ android:layout_marginRight="16dip"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/pano_dialog_title"
+ android:minHeight="64dp"/>
+ <View style="@style/PopupTitleSeparator" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:background="@color/popup_background"
+ android:padding="9dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <TextView
+ style="@style/TextAppearance.Medium"
+ android:id="@+id/pano_dialog_text"
+ android:layout_gravity="center_vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/pano_dialog_panorama_failed" />
+ </LinearLayout>
+
+ <ImageView android:background="@drawable/list_divider"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
+ <LinearLayout android:id="@+id/pano_dialog_button_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:minHeight="48dp"
+ android:orientation="horizontal">
+
+ <Button android:id="@+id/pano_dialog_button1"
+ style="@style/Widget.Button.Borderless"
+ android:gravity="center"
+ android:maxLines="1"
+ android:minHeight="48dp"
+ android:textSize="14sp"
+ android:text="@string/dialog_ok"
+ android:layout_weight="1"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content" />
+ </LinearLayout>
+ </LinearLayout>
+ </com.android.camera.ui.RotateLayout>
+
<include layout="@layout/camera_controls"
android:layout_gravity="center"
style="@style/CameraControls"/>
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index 230c31c..862e4d2 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);