if (mCurrentModule == null) {
return;
}
- int visibility;
+
+ int visibility = getPreviewVisibility();
+ updatePreviewRendering(visibility);
+ mCurrentModule.onPreviewVisibilityChanged(visibility);
+ }
+
+ private void updatePreviewRendering(int visibility) {
+ if (visibility == ModuleController.VISIBILITY_HIDDEN) {
+ mCameraAppUI.pausePreviewRendering();
+ } else {
+ mCameraAppUI.resumePreviewRendering();
+ }
+ }
+
+ private int getPreviewVisibility() {
if (mFilmstripCoversPreview) {
- visibility = ModuleController.VISIBILITY_HIDDEN;
+ return ModuleController.VISIBILITY_HIDDEN;
} else if (mModeListVisible){
- visibility = ModuleController.VISIBILITY_COVERED;
+ return ModuleController.VISIBILITY_COVERED;
} else {
- visibility = ModuleController.VISIBILITY_VISIBLE;
+ return ModuleController.VISIBILITY_VISIBLE;
}
- mCurrentModule.onPreviewVisibilityChanged(visibility);
}
private void setRotationAnimation() {
mPanoramaViewHelper.onResume();
ReleaseDialogHelper.showReleaseInfoDialogOnStart(this, mSettingsManager);
syncLocationManagerSetting();
+
+ final int previewVisibility = getPreviewVisibility();
+ updatePreviewRendering(previewVisibility);
}
@Override
}
}
+ /**
+ * Call to stop the preview from being rendered.
+ */
+ public void pausePreviewRendering() {
+ mTextureView.setVisibility(View.INVISIBLE);
+ }
+
+ /**
+ * Call to begin rendering the preview again.
+ */
+ public void resumePreviewRendering() {
+ mTextureView.setVisibility(View.VISIBLE);
+ }
+
@Override
public void onOpenFullScreen() {
if (mShouldShowShimmy) {