summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-11-22 01:57:02 +0100
committerArne Coucheron <arco68@gmail.com>2018-01-26 01:09:05 +0100
commite58747d32ce2873300e336ab1fe762fbad60f500 (patch)
tree9c09e1699c1f67a05b4eb6d52e93d99ae0505ab6
parent331f645f332a7c6d130e3411c58e78c54477643d (diff)
downloadandroid_packages_apps_Snap-e58747d32ce2873300e336ab1fe762fbad60f500.zip
android_packages_apps_Snap-e58747d32ce2873300e336ab1fe762fbad60f500.tar.gz
android_packages_apps_Snap-e58747d32ce2873300e336ab1fe762fbad60f500.tar.bz2
snap: Panorama fixes
Change-Id: I9474219c57fc204dd16797aa8921296e61cc9d37
-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--src/com/android/camera/PanoProgressBar.java4
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java8
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java10
7 files changed, 28 insertions, 15 deletions
diff --git a/res/layout/pano_module_capture.xml b/res/layout/pano_module_capture.xml
index b67315c..4e84187 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 aecf6f8..0a5f164 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 eeb2ebe..4b51bda 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 5ae3002..d8748cc 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/src/com/android/camera/PanoProgressBar.java b/src/com/android/camera/PanoProgressBar.java
index d20878a..45f08a5 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 0f9679b..9abfbe3 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -692,7 +692,6 @@ public class WideAnglePanoramaModule
}
public void reportProgress() {
- mUI.showUI();
mUI.resetSavingProgress();
Thread t = new Thread() {
@Override
@@ -1150,6 +1149,13 @@ public class WideAnglePanoramaModule
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 f2c6e2b..99b08b9 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -99,7 +99,6 @@ public class WideAnglePanoramaUI implements
// Color definitions.
private int mIndicatorColor;
private int mIndicatorColorFast;
- private int mReviewBackground;
private SurfaceTexture mSurfaceTexture;
private View mPreviewCover;
@@ -442,7 +441,6 @@ public class WideAnglePanoramaUI implements
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);
mPreviewCover = mRootView.findViewById(R.id.preview_cover);
@@ -471,7 +469,6 @@ public class WideAnglePanoramaUI implements
mShutterButton.setOnShutterButtonListener(this);
// Hide menu
mRootView.findViewById(R.id.menu).setVisibility(View.GONE);
- mReview.setBackgroundColor(mReviewBackground);
// TODO: set display change listener properly.
((CameraRootView) mRootView).setDisplayChangeListener(null);
@@ -707,4 +704,11 @@ public class WideAnglePanoramaUI implements
mCameraControls.setOrientation(orientation, animation);
RotateTextToast.setOrientation(orientation);
}
+
+ public void hidePreviewCover() {
+ // Hide the preview cover if need.
+ if (mPreviewCover.getVisibility() != View.GONE) {
+ mPreviewCover.setVisibility(View.GONE);
+ }
+ }
}