diff options
author | Steve Kondik <steve@cyngn.com> | 2016-11-22 01:57:02 +0100 |
---|---|---|
committer | Chippa-a <vusal1372@gmail.com> | 2019-10-25 15:55:25 +0300 |
commit | b1319c956afe6c027062e3f6432bb8e06bb980a6 (patch) | |
tree | 7bd52bae130f9bf54d97fa5690cc2c8526942528 /src/com/android/camera | |
parent | 90b91bff51f505e017b9b10f4005e998a5837037 (diff) | |
download | android_packages_apps_Snap-b1319c956afe6c027062e3f6432bb8e06bb980a6.tar.gz android_packages_apps_Snap-b1319c956afe6c027062e3f6432bb8e06bb980a6.tar.bz2 android_packages_apps_Snap-b1319c956afe6c027062e3f6432bb8e06bb980a6.zip |
snap: Panorama fixes
Change-Id: I9474219c57fc204dd16797aa8921296e61cc9d37
Diffstat (limited to 'src/com/android/camera')
-rw-r--r-- | src/com/android/camera/PanoProgressBar.java | 4 | ||||
-rw-r--r-- | src/com/android/camera/WideAnglePanoramaModule.java | 8 | ||||
-rw-r--r-- | src/com/android/camera/WideAnglePanoramaUI.java | 10 |
3 files changed, 17 insertions, 5 deletions
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 1ae5ffb02..903469e10 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 @@ -1152,6 +1151,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 f2c6e2bb7..99b08b9b5 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); + } + } } |