diff options
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 9 | ||||
-rw-r--r-- | src/com/android/camera/VideoModule.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/VideoUI.java | 9 | ||||
-rw-r--r-- | src/com/android/camera/ui/CameraRootView.java | 4 |
5 files changed, 24 insertions, 2 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index ff28700c1..d06d7417e 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -1191,6 +1191,7 @@ public class PhotoModule } else { initializeSecondTime(); } + mUI.initDisplayChangeListener(); keepScreenOnAwhile(); UsageStatistics.onContentViewChanged( @@ -1261,6 +1262,7 @@ public class PhotoModule if (s != null) { s.setListener(null); } + mUI.removeDisplayChangeListener(); } /** diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 3b4d04dc7..31f7ef826 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -222,7 +222,6 @@ public class PhotoUI implements PieListener, setSurfaceTextureSizeChangedListener(mFaceView); } mCameraControls = (CameraControls) mRootView.findViewById(R.id.camera_controls); - ((CameraRootView) mRootView).setDisplayChangeListener(this); mAnimationManager = new AnimationManager(); } @@ -763,6 +762,14 @@ public class PhotoUI implements PieListener, mPreviewHeight = 0; } + public void initDisplayChangeListener() { + ((CameraRootView) mRootView).setDisplayChangeListener(this); + } + + public void removeDisplayChangeListener() { + ((CameraRootView) mRootView).removeDisplayChangeListener(); + } + // focus UI implementation private FocusIndicator getFocusIndicator() { diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 4daf01a5a..012376c82 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -679,6 +679,7 @@ public class VideoModule implements CameraModule, mUI.enableShutter(true); } + mUI.initDisplayChangeListener(); // Initializing it here after the preview is started. mUI.initializeZoom(mParameters); @@ -827,6 +828,7 @@ public class VideoModule implements CameraModule, mPreferenceRead = false; mUI.collapseCameraControls(); + mUI.removeDisplayChangeListener(); } @Override diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index 7080032f4..fc7113f3b 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -167,7 +167,6 @@ public class VideoUI implements PieRenderer.PieListener, mTextureView = (TextureView) mRootView.findViewById(R.id.preview_content); mTextureView.setSurfaceTextureListener(this); mTextureView.addOnLayoutChangeListener(mLayoutListener); - ((CameraRootView) mRootView).setDisplayChangeListener(this); mFlashOverlay = mRootView.findViewById(R.id.flash_overlay); mShutterButton = (ShutterButton) mRootView.findViewById(R.id.shutter_button); mSwitcher = (ModuleSwitcher) mRootView.findViewById(R.id.camera_switcher); @@ -377,6 +376,14 @@ public class VideoUI implements PieRenderer.PieListener, } } + public void initDisplayChangeListener() { + ((CameraRootView) mRootView).setDisplayChangeListener(this); + } + + public void removeDisplayChangeListener() { + ((CameraRootView) mRootView).removeDisplayChangeListener(); + } + public void overrideSettings(final String... keyvalues) { mVideoMenu.overrideSettings(keyvalues); } diff --git a/src/com/android/camera/ui/CameraRootView.java b/src/com/android/camera/ui/CameraRootView.java index 1e4708ec7..505549c80 100644 --- a/src/com/android/camera/ui/CameraRootView.java +++ b/src/com/android/camera/ui/CameraRootView.java @@ -88,6 +88,10 @@ public class CameraRootView extends FrameLayout { } } + public void removeDisplayChangeListener() { + mListener = null; + } + public void setDisplayChangeListener(MyDisplayListener listener) { mListener = listener; } |