diff options
author | Sascha Haeberling <haeberling@google.com> | 2013-08-06 14:31:52 -0700 |
---|---|---|
committer | Sascha Haeberling <haeberling@google.com> | 2013-08-06 14:58:07 -0700 |
commit | 37f3611bbdc787c996a99894dcef7d8fb77e3f7c (patch) | |
tree | 4dc08a60a543dc4d2b0672a8c0cc4efdc30b52ad /src/com/android/camera/VideoUI.java | |
parent | 8fe71f31bc8ab1b634566a3060e041e22e9b2e41 (diff) | |
download | android_packages_apps_Snap-37f3611bbdc787c996a99894dcef7d8fb77e3f7c.tar.gz android_packages_apps_Snap-37f3611bbdc787c996a99894dcef7d8fb77e3f7c.tar.bz2 android_packages_apps_Snap-37f3611bbdc787c996a99894dcef7d8fb77e3f7c.zip |
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
Diffstat (limited to 'src/com/android/camera/VideoUI.java')
-rw-r--r-- | src/com/android/camera/VideoUI.java | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index 06c9795f3..1f6505fcf 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -91,6 +91,7 @@ public class VideoUI implements PieRenderer.PieListener, 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 @@ public class VideoUI implements PieRenderer.PieListener, 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 @@ public class VideoUI implements PieRenderer.PieListener, 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 @@ public class VideoUI implements PieRenderer.PieListener, initializeMiscControls(); initializeControlByIntent(); initializeOverlay(); + mAnimationManager = new AnimationManager(); } @@ -266,6 +270,29 @@ public class VideoUI implements PieRenderer.PieListener, } } + /** + * 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 @@ public class VideoUI implements PieRenderer.PieListener, 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) { |