Show a preview cover until real preview is ready

Bug: 11211650
Change-Id: Ic4b26ef0f03eac0682e7be0d4bcb1c4632d85f39
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 23d08db..02b2567 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -93,6 +93,7 @@
     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 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 @@
         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 @@
     @Override
     public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
         mSurfaceTexture = surface;
+        mPreviewCover.setVisibility(View.GONE);
         mController.onPreviewUIReady();
     }