OSDN Git Service

Hide bottom bar of Camera when filmstrip is visible
authorAlan Newberger <alann@google.com>
Wed, 26 Mar 2014 21:51:12 +0000 (14:51 -0700)
committerAlan Newberger <alann@google.com>
Thu, 27 Mar 2014 01:24:48 +0000 (18:24 -0700)
This CL hides the bottom bar, i.e. capture button and onscreen indicators,
when the filmstrip is visible. We hide a wrapper; modules may independently
control the visibility of the items in the wrapper e.g. Photo Sphere turns
the actual buttons invisible even if the wrapper becomes visible.

This change takes care of the most egregious issues with widgets visible to
TalkBack under the filmstrip, but there are still others e.g. 'align to start'
for Photo Sphere, can be navigated to. I'll file a separate bug to pursue
a more aggressive wrapper visibility toggle which turns off the whole camera
preview, mode switcher, etc.

Bug: 13644558
Bug: 13589550
Change-Id: I1cf7e9079210c85f29b3e35e0f7dbf176b86976e

src/com/android/camera/CameraActivity.java
src/com/android/camera/app/CameraAppUI.java

index f6f0875..dbc04b9 100644 (file)
@@ -1360,9 +1360,18 @@ public class CameraActivity extends Activity
 
         int visibility = getPreviewVisibility();
         updatePreviewRendering(visibility);
+        updateCaptureControls(visibility);
         mCurrentModule.onPreviewVisibilityChanged(visibility);
     }
 
+    private void updateCaptureControls(int visibility) {
+        if (visibility == ModuleController.VISIBILITY_HIDDEN) {
+            mCameraAppUI.setIndicatorBottomBarWrapperVisible(false);
+        } else {
+            mCameraAppUI.setIndicatorBottomBarWrapperVisible(true);
+        }
+    }
+
     private void updatePreviewRendering(int visibility) {
         if (visibility == ModuleController.VISIBILITY_HIDDEN) {
             mCameraAppUI.pausePreviewRendering();
index 0953b26..cee03cf 100644 (file)
@@ -449,7 +449,7 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
     private IndicatorIconController mIndicatorIconController;
     private View mFocusOverlay;
     private FrameLayout mTutorialsPlaceholder;
-
+    private View mIndicatorBottomBarWrapper;
     private TextureViewHelper mTextureViewHelper;
     private final GestureDetector mGestureDetector;
     private DisplayManager.DisplayListener mDisplayListener;
@@ -1035,6 +1035,8 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
         mFocusOverlay = mCameraRootView.findViewById(R.id.focus_overlay);
         mTutorialsPlaceholder = (FrameLayout) mCameraRootView
                 .findViewById(R.id.tutorials_placeholder);
+        mIndicatorBottomBarWrapper = (View) mAppRootView
+                .findViewById(R.id.indicator_bottombar_wrapper);
 
         mTextureViewHelper.addPreviewAreaSizeChangedListener(
                 new PreviewStatusListener.PreviewAreaChangedListener() {
@@ -1437,8 +1439,8 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
         mBottomBar.setCaptureButtonEnabled(enabled);
     }
 
-    public void setModeOptionsVisible(boolean visible) {
-        mModeOptionsOverlay.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
+    public void setIndicatorBottomBarWrapperVisible(boolean visible) {
+        mIndicatorBottomBarWrapper.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
     }
 
     /**