summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2013-10-17 17:46:48 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-17 17:46:48 +0000
commit8470cae9049959ee6bb28cde1c53185f2ffd10a1 (patch)
tree4d59a5eff928fa20c58f9297971546a9f391c68a /src/com
parentf149ec53a0fa3330617ce01751964662d3273c88 (diff)
parent3a45c33d74fe0ad0ade9be3d037560a53891c627 (diff)
downloadandroid_packages_apps_Snap-8470cae9049959ee6bb28cde1c53185f2ffd10a1.tar.gz
android_packages_apps_Snap-8470cae9049959ee6bb28cde1c53185f2ffd10a1.tar.bz2
android_packages_apps_Snap-8470cae9049959ee6bb28cde1c53185f2ffd10a1.zip
Merge "Show a preview cover until real preview is ready" into gb-ub-photos-carlsbad
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/PhotoModule.java3
-rw-r--r--src/com/android/camera/PhotoUI.java7
-rw-r--r--src/com/android/camera/VideoModule.java1
-rw-r--r--src/com/android/camera/VideoUI.java7
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java2
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java7
6 files changed, 26 insertions, 1 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 6256bfbf3..aeca3ddef 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1190,6 +1190,7 @@ public class PhotoModule
@Override
public void onResumeAfterSuper() {
+ Log.v(TAG, "On resume.");
if (mOpenCameraFail || mCameraDisabled) return;
mJpegPictureCallbackTime = 0;
@@ -1240,6 +1241,8 @@ public class PhotoModule
@Override
public void onPauseAfterSuper() {
+ Log.v(TAG, "On pause.");
+ mUI.showPreviewCover();
// When camera is started from secure lock screen for the first time
// after screen on, the activity gets onCreate->onResume->onPause->onResume.
// To reduce the latency, keep the camera for a short time so it does
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index b966b7b30..cd3b9a52f 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -115,6 +115,7 @@ public class PhotoUI implements PieListener,
private TextureView mTextureView;
private Matrix mMatrix = null;
private float mAspectRatio = 4f / 3f;
+ private View mPreviewCover;
public interface SurfaceTextureSizeChangedListener {
public void onSurfaceTextureSizeChanged(int uncroppedWidth, int uncroppedHeight);
@@ -196,6 +197,7 @@ public class PhotoUI implements PieListener,
(ViewGroup) mRootView, true);
mRenderOverlay = (RenderOverlay) mRootView.findViewById(R.id.render_overlay);
mFlashOverlay = mRootView.findViewById(R.id.flash_overlay);
+ mPreviewCover = mRootView.findViewById(R.id.preview_cover);
// display the view
mTextureView = (TextureView) mRootView.findViewById(R.id.preview_content);
mTextureView.setSurfaceTextureListener(this);
@@ -256,6 +258,7 @@ public class PhotoUI implements PieListener,
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
Log.v(TAG, "SurfaceTexture ready.");
+ mPreviewCover.setVisibility(View.GONE);
mSurfaceTexture = surface;
mController.onPreviewUIReady();
// Workaround for b/11168275, see b/10981460 for more details
@@ -756,6 +759,10 @@ public class PhotoUI implements PieListener,
mNotSelectableToast.show();
}
+ public void showPreviewCover() {
+ mPreviewCover.setVisibility(View.VISIBLE);
+ }
+
public void onPause() {
cancelCountDown();
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index fdd48e264..0ee62bb9d 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -783,6 +783,7 @@ public class VideoModule implements CameraModule,
public void onPauseBeforeSuper() {
mPaused = true;
+ mUI.showPreviewCover();
if (mMediaRecorderRecording) {
// Camera will be released in onStopVideoRecording.
onStopVideoRecording();
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 23d08dbb4..02b256754 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -93,6 +93,7 @@ public class VideoUI implements PieRenderer.PieListener,
private View mPreviewThumb;
private View mFlashOverlay;
+ private View mPreviewCover;
private SurfaceView mSurfaceView = null;
private int mPreviewWidth = 0;
private int mPreviewHeight = 0;
@@ -134,6 +135,10 @@ public class VideoUI implements PieRenderer.PieListener,
}
};
+ public void showPreviewCover() {
+ mPreviewCover.setVisibility(View.VISIBLE);
+ }
+
private class SettingsPopup extends PopupWindow {
public SettingsPopup(View popup) {
super(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
@@ -168,6 +173,7 @@ public class VideoUI implements PieRenderer.PieListener,
mController = controller;
mRootView = parent;
mActivity.getLayoutInflater().inflate(R.layout.video_module, (ViewGroup) mRootView, true);
+ mPreviewCover = mRootView.findViewById(R.id.preview_cover);
mTextureView = (TextureView) mRootView.findViewById(R.id.preview_content);
mTextureView.setSurfaceTextureListener(this);
mTextureView.addOnLayoutChangeListener(mLayoutListener);
@@ -712,6 +718,7 @@ public class VideoUI implements PieRenderer.PieListener,
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
mSurfaceTexture = surface;
+ mPreviewCover.setVisibility(View.GONE);
mController.onPreviewUIReady();
}
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index aa66bdcd3..db4e59d2e 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -805,7 +805,7 @@ public class WideAnglePanoramaModule
stopCapture(true);
reset();
}
-
+ mUI.showPreviewCover();
releaseCamera();
synchronized (mRendererLock) {
mCameraTexture = null;
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index da49638cc..b0f3de40b 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -89,6 +89,7 @@ public class WideAnglePanoramaUI implements
private int mIndicatorColorFast;
private int mReviewBackground;
private SurfaceTexture mSurfaceTexture;
+ private View mPreviewCover;
/** Constructor. */
public WideAnglePanoramaUI(
@@ -225,6 +226,7 @@ public class WideAnglePanoramaUI implements
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i2) {
mSurfaceTexture = surfaceTexture;
+ mPreviewCover.setVisibility(View.GONE);
mController.onPreviewUIReady();
}
@@ -346,6 +348,7 @@ public class WideAnglePanoramaUI implements
mReviewBackground = appRes.getColor(R.color.review_background);
mIndicatorColorFast = appRes.getColor(R.color.pano_progress_indication_fast);
+ mPreviewCover = mRootView.findViewById(R.id.preview_cover);
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);
@@ -453,6 +456,10 @@ public class WideAnglePanoramaUI implements
((CameraRootView) mRootView).removeDisplayChangeListener();
}
+ public void showPreviewCover() {
+ mPreviewCover.setVisibility(View.VISIBLE);
+ }
+
private class DialogHelper {
private ProgressDialog mProgressDialog;
private AlertDialog mAlertDialog;