summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/WideAnglePanoramaUI.java
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2013-10-14 12:06:20 -0700
committerDoris Liu <tianliu@google.com>2013-10-14 12:06:20 -0700
commit352b014552d77948193d84ec177c7673552eb1ee (patch)
treefd6023c568c1ae31cb2047a334b4094065c99291 /src/com/android/camera/WideAnglePanoramaUI.java
parentae1697302b4ef59bbfebdf1127bc73531ce550b7 (diff)
downloadandroid_packages_apps_Snap-352b014552d77948193d84ec177c7673552eb1ee.tar.gz
android_packages_apps_Snap-352b014552d77948193d84ec177c7673552eb1ee.tar.bz2
android_packages_apps_Snap-352b014552d77948193d84ec177c7673552eb1ee.zip
Fix SRI upside down preview in reverse landscape and reverse portrait
Also make sure preview is not upside down after device flip, and fix camera controls jiggering during rotation Bug: 11216647 Bug: 11174540 Change-Id: I764e5b86549fa87c2224d8e85ff06f57f0a315d1
Diffstat (limited to 'src/com/android/camera/WideAnglePanoramaUI.java')
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index 407160933..202303091 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -43,6 +43,7 @@ import android.widget.TextView;
import com.android.camera.ui.CameraControls;
import com.android.camera.ui.CameraRootView;
import com.android.camera.ui.ModuleSwitcher;
+import com.android.camera.util.CameraUtil;
import com.android.camera2.R;
/**
@@ -51,6 +52,7 @@ import com.android.camera2.R;
public class WideAnglePanoramaUI implements
TextureView.SurfaceTextureListener,
ShutterButton.OnShutterButtonListener,
+ CameraRootView.MyDisplayListener,
View.OnLayoutChangeListener {
@SuppressWarnings("unused")
@@ -61,7 +63,6 @@ public class WideAnglePanoramaUI implements
private ViewGroup mRootView;
private ModuleSwitcher mSwitcher;
- private ViewGroup mPanoLayout;
private FrameLayout mCaptureLayout;
private View mReviewLayout;
private ImageView mReview;
@@ -274,7 +275,7 @@ public class WideAnglePanoramaUI implements
mReviewControl.removeAllViews();
inflater.inflate(R.layout.pano_review_control, mReviewControl, true);
- mPanoLayout.bringChildToFront(mCameraControls);
+ mRootView.bringChildToFront(mCameraControls);
setViews(mActivity.getResources());
if (threadRunning) {
mReview.setImageDrawable(lowResReview);
@@ -333,7 +334,6 @@ public class WideAnglePanoramaUI implements
mReviewBackground = appRes.getColor(R.color.review_background);
mIndicatorColorFast = appRes.getColor(R.color.pano_progress_indication_fast);
- mPanoLayout = (ViewGroup) mRootView.findViewById(R.id.pano_layout);
mPreviewLayout = mRootView.findViewById(R.id.pano_preview_layout);
mReviewControl = (ViewGroup) mRootView.findViewById(R.id.pano_review_control);
mReviewLayout = mRootView.findViewById(R.id.pano_review_layout);
@@ -418,6 +418,29 @@ public class WideAnglePanoramaUI implements
mRightIndicator.setEnabled(false);
}
+ public void flipPreviewIfNeeded() {
+ if (CameraUtil.getDisplayRotation(mActivity) >= 180) {
+ // In either reverse landscape or reverse portrait
+ mTextureView.setRotation(180);
+ } else {
+ mTextureView.setRotation(0);
+ }
+ }
+
+ @Override
+ public void onDisplayChanged() {
+ mCameraControls.checkLayoutFlip();
+ flipPreviewIfNeeded();
+ }
+
+ public void initDisplayChangeListener() {
+ ((CameraRootView) mRootView).setDisplayChangeListener(this);
+ }
+
+ public void removeDisplayChangeListener() {
+ ((CameraRootView) mRootView).removeDisplayChangeListener();
+ }
+
private class DialogHelper {
private ProgressDialog mProgressDialog;
private AlertDialog mAlertDialog;