summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/drawable-hdpi/exit_panorama.pngbin0 -> 1178 bytes
-rw-r--r--res/layout/camera_controls.xml2
-rw-r--r--res/layout/pano_module_capture.xml12
-rw-r--r--res/layout/pano_module_review.xml1
-rw-r--r--res/layout/pano_review_control.xml2
-rw-r--r--res/layout/panorama_module.xml6
-rw-r--r--res/values/config.xml2
-rw-r--r--src/com/android/camera/CameraActivity.java4
-rw-r--r--src/com/android/camera/PanoProgressBar.java4
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java10
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java16
-rw-r--r--src/com/android/camera/ui/CameraControls.java6
12 files changed, 37 insertions, 28 deletions
diff --git a/res/drawable-hdpi/exit_panorama.png b/res/drawable-hdpi/exit_panorama.png
new file mode 100644
index 000000000..15161d503
--- /dev/null
+++ b/res/drawable-hdpi/exit_panorama.png
Binary files differ
diff --git a/res/layout/camera_controls.xml b/res/layout/camera_controls.xml
index 39bedb059..1d1314eac 100644
--- a/res/layout/camera_controls.xml
+++ b/res/layout/camera_controls.xml
@@ -73,7 +73,7 @@
android:layout_height="@dimen/preview_bottom_margin"
android:gravity="center"
android:weightSum="100"
- android:background="@drawable/camera_controls_bg_translucent"
+ android:background="@drawable/camera_controls_bg_opaque"
android:orientation="horizontal">
<com.android.camera.ui.RotateImageView
diff --git a/res/layout/pano_module_capture.xml b/res/layout/pano_module_capture.xml
index 1398b53dc..c6ea2b22a 100644
--- a/res/layout/pano_module_capture.xml
+++ b/res/layout/pano_module_capture.xml
@@ -16,6 +16,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/panorama_capture_layout"
+ android:background="@android:color/black"
android:layout_width="match_parent"
android:layout_height="match_parent" >
@@ -36,6 +37,13 @@
android:layout_height="match_parent"
android:background="@drawable/ic_pan_border_fast"
android:visibility="gone" />
+
+ <View
+ android:id="@+id/preview_cover"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/black" />
+
</FrameLayout>
<LinearLayout
@@ -73,9 +81,7 @@
style="@style/PanoViewHorizontalBar"
android:layout_width="match_parent"
android:layout_height="0dp"
- android:layout_weight="1"
- android:gravity="top"
- android:paddingTop="20dp" >
+ android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
diff --git a/res/layout/pano_module_review.xml b/res/layout/pano_module_review.xml
index aecf6f8b2..0a5f164f1 100644
--- a/res/layout/pano_module_review.xml
+++ b/res/layout/pano_module_review.xml
@@ -18,6 +18,7 @@
android:id="@+id/pano_review_layout"
android:orientation="vertical"
android:visibility="invisible"
+ android:background="@android:color/black"
android:layout_height="match_parent"
android:layout_width="match_parent">
diff --git a/res/layout/pano_review_control.xml b/res/layout/pano_review_control.xml
index eeb2ebee4..4b51bda3b 100644
--- a/res/layout/pano_review_control.xml
+++ b/res/layout/pano_review_control.xml
@@ -29,5 +29,5 @@
style="@style/ReviewControlIcon"
android:contentDescription="@string/accessibility_review_cancel"
android:layout_gravity="center_horizontal|bottom"
- android:src="@drawable/ic_menu_cancel_holo_light" />
+ android:src="@drawable/exit_panorama" />
</merge>
diff --git a/res/layout/panorama_module.xml b/res/layout/panorama_module.xml
index b1d0ded17..a5fcfb656 100644
--- a/res/layout/panorama_module.xml
+++ b/res/layout/panorama_module.xml
@@ -19,12 +19,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/pano_module_capture" />
- <View
- android:id="@+id/preview_cover"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@android:color/black"
- android:visibility="gone" />
<com.android.camera.ui.RotateLayout
android:id="@+id/waitingDialog"
diff --git a/res/values/config.xml b/res/values/config.xml
index 883ffc13f..2c47154cd 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -27,7 +27,7 @@
<!-- This value may be changed to true to enable the warped pano preview overlayed on top
of the fullscreen pano preview. -->
- <bool name="enable_warped_pano_preview">true</bool>
+ <bool name="enable_warped_pano_preview">false</bool>
<!-- Set's parameter "lge-camera" for LGE devices. -->
<bool name="lge_camera">false</bool>
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index b0aad3640..21fe6516e 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -2424,4 +2424,8 @@ public class CameraActivity extends Activity
}
public SettingsManager getSettingsManager() {return mSettingsManager;}
+
+ public int getCurrentModuleIndex() {
+ return mCurrentModuleIndex;
+ }
}
diff --git a/src/com/android/camera/PanoProgressBar.java b/src/com/android/camera/PanoProgressBar.java
index d20878a84..45f08a53e 100644
--- a/src/com/android/camera/PanoProgressBar.java
+++ b/src/com/android/camera/PanoProgressBar.java
@@ -142,7 +142,9 @@ class PanoProgressBar extends ImageView {
// When user move to the opposite direction more than 10 degrees,
// change the direction and stop the capture progress in PanoramaModule.
if (Math.abs(mOldProgress) - Math.abs(progress) > 10) {
- mListener.onDirectionChange(mDirection/2 + 1);
+ if (mListener != null) {
+ mListener.onDirectionChange(mDirection / 2 + 1);
+ }
return;
}
// mDirection might be modified by setRightIncreasing() above. Need to check again.
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index d7a3d54d4..59b71e06b 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -653,7 +653,7 @@ public class WideAnglePanoramaModule extends BaseModule<WideAnglePanoramaUI> imp
mUI.showWaitingDialog(mPreparePreviewString);
// Hide shutter button, shutter icon, etc when waiting for
// panorama to stitch
- mUI.hideUI();
+ mUI.hideUI(true);
runBackgroundThread(new Thread() {
@Override
public void run() {
@@ -704,7 +704,6 @@ public class WideAnglePanoramaModule extends BaseModule<WideAnglePanoramaUI> imp
}
public void reportProgress() {
- mUI.showUI();
mUI.resetSavingProgress();
Thread t = new Thread() {
@Override
@@ -1164,6 +1163,13 @@ public class WideAnglePanoramaModule extends BaseModule<WideAnglePanoramaUI> imp
mCameraTexture.setOnFrameAvailableListener(this);
mCameraDevice.setPreviewTexture(mCameraTexture);
}
+ mCameraDevice.setOneShotPreviewCallback(mMainHandler,
+ new CameraManager.CameraPreviewDataCallback() {
+ @Override
+ public void onPreviewFrame(byte[] data, CameraProxy camera) {
+ mUI.hidePreviewCover();
+ }
+ });
mCameraDevice.startPreview();
mCameraState = PREVIEW_ACTIVE;
}
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index 19dd01b5b..548ef314f 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -92,7 +92,6 @@ public class WideAnglePanoramaUI extends BaseUI implements
// Color definitions.
private int mIndicatorColor;
private int mIndicatorColorFast;
- private int mReviewBackground;
private SurfaceTexture mSurfaceTexture;
private int mOrientation;
@@ -137,6 +136,7 @@ public class WideAnglePanoramaUI extends BaseUI implements
}
public void showPreviewUI() {
+ Log.d(TAG, "showPreviewUI");
mCaptureLayout.setVisibility(View.VISIBLE);
showUI();
}
@@ -147,14 +147,6 @@ public class WideAnglePanoramaUI extends BaseUI implements
hideDirectionIndicators();
}
- public void onPreviewFocusChanged(boolean previewFocused) {
- if (previewFocused) {
- showUI();
- } else {
- hideUI();
- }
- }
-
public void setCaptureProgressOnDirectionChangeListener(
PanoProgressBar.OnDirectionChangeListener listener) {
mCaptureProgressBar.setOnDirectionChangeListener(listener);
@@ -228,7 +220,6 @@ public class WideAnglePanoramaUI extends BaseUI implements
mSurfaceTexture = surfaceTexture;
mController.onPreviewUIReady();
mActivity.updateThumbnail(mThumbnail);
- hidePreviewCover();
}
@Override
@@ -257,12 +248,15 @@ public class WideAnglePanoramaUI extends BaseUI implements
}
public void reset() {
+ Log.d(TAG, "reset");
mShutterButton.setImageResource(R.drawable.btn_new_shutter_panorama);
mReviewLayout.setVisibility(View.GONE);
mCaptureProgressBar.setVisibility(View.INVISIBLE);
}
public void saveFinalMosaic(Bitmap bitmap, int orientation) {
+ Log.d(TAG, "saveFinalMosaic");
+
if (bitmap != null && orientation != 0) {
Matrix rotateMatrix = new Matrix();
rotateMatrix.setRotate(orientation);
@@ -386,7 +380,6 @@ public class WideAnglePanoramaUI extends BaseUI implements
private void createContentView() {
Resources appRes = mActivity.getResources();
mIndicatorColor = appRes.getColor(R.color.pano_progress_indication);
- mReviewBackground = appRes.getColor(R.color.review_background);
mIndicatorColorFast = appRes.getColor(R.color.pano_progress_indication_fast);
mPreviewLayout = mRootView.findViewById(R.id.pano_preview_layout);
@@ -414,7 +407,6 @@ public class WideAnglePanoramaUI extends BaseUI implements
mShutterButton.addOnShutterButtonListener(this);
// Hide menu
mRootView.findViewById(R.id.menu).setVisibility(View.GONE);
- mReview.setBackgroundColor(mReviewBackground);
// TODO: set display change listener properly.
((CameraRootView) mRootView).setDisplayChangeListener(null);
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index 66bf4e010..1436390d3 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -461,7 +461,11 @@ public class CameraControls extends RotatableLayout {
public void setPreviewRect(RectF rectL) {
int r = CameraUtil.determineRatio(Math.round(rectL.width()), Math.round(rectL.height()));
mPreviewRatio = r;
- if (mPreviewRatio == CameraUtil.RATIO_4_3 && mTopMargin != 0) {
+
+ boolean pano = ((CameraActivity) getContext()).getCurrentModuleIndex() ==
+ ModuleSwitcher.WIDE_ANGLE_PANO_MODULE_INDEX;
+
+ if (pano || (mPreviewRatio == CameraUtil.RATIO_4_3 && mTopMargin != 0)) {
mBottomBar.setBackgroundResource(R.drawable.camera_controls_bg_opaque);
} else {
mBottomBar.setBackgroundResource(R.drawable.camera_controls_bg_translucent);