This adds the following four CLs to Camera2:

  http://ag/339319
  http://ag/338974
  http://ag/338401
  http://ag/324149

Adapted to work in Camera2 and adding a .gitignore so that temporary
Eclipse files and folders are not submitted.

Change-Id: I40295c7f0139f76270c44f0ca395c0574a288569
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 06c9795..1f6505f 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -91,6 +91,7 @@
     private int mZoomMax;
     private List<Integer> mZoomRatios;
     private View mPreviewThumb;
+    private View mFlashOverlay;
 
     private SurfaceView mSurfaceView = null;
     private int mPreviewWidth = 0;
@@ -99,6 +100,7 @@
     private float mSurfaceTextureUncroppedHeight;
     private float mAspectRatio = 4f / 3f;
     private Matrix mMatrix = null;
+    private final AnimationManager mAnimationManager;
     private final Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
@@ -141,6 +143,7 @@
         mTextureView.setSurfaceTextureListener(this);
         mRootView.addOnLayoutChangeListener(mLayoutListener);
         ((CameraRootView) mRootView).setDisplayChangeListener(this);
+        mFlashOverlay = mRootView.findViewById(R.id.flash_overlay);
         mShutterButton = (ShutterButton) mRootView.findViewById(R.id.shutter_button);
         mSwitcher = (CameraSwitcher) mRootView.findViewById(R.id.camera_switcher);
         mSwitcher.setCurrentIndex(CameraSwitcher.VIDEO_MODULE_INDEX);
@@ -148,6 +151,7 @@
         initializeMiscControls();
         initializeControlByIntent();
         initializeOverlay();
+        mAnimationManager = new AnimationManager();
     }
 
 
@@ -266,6 +270,29 @@
         }
     }
 
+    /**
+     * Starts a flash animation
+     */
+    public void animateFlash() {
+        mAnimationManager.startFlashAnimation(mFlashOverlay);
+    }
+
+    /**
+     * Starts a capture animation
+     * @param bitmap the captured image that we shrink and slide in the animation
+     */
+    public void animateCapture(Bitmap bitmap) {
+        ((ImageView) mPreviewThumb).setImageBitmap(bitmap);
+        mAnimationManager.startCaptureAnimation(mPreviewThumb);
+    }
+
+    /**
+     * Cancels on-going animations
+     */
+    public void cancelAnimations() {
+        mAnimationManager.cancelAnimations();
+    }
+
     public void hideUI() {
         mCameraControls.setVisibility(View.INVISIBLE);
         mSwitcher.closePopup();
@@ -623,17 +650,6 @@
         mController.updateCameraOrientation();
     }
 
-    /**
-     * Enable or disable the preview thumbnail for click events.
-     */
-    public void enablePreviewThumb(boolean enabled) {
-        if (enabled) {
-            mPreviewThumb.setVisibility(View.VISIBLE);
-        } else {
-            mPreviewThumb.setVisibility(View.GONE);
-        }
-    }
-
     private class ZoomChangeListener implements ZoomRenderer.OnZoomChangedListener {
         @Override
         public void onZoomValueChanged(int index) {