diff options
author | Steve Kondik <steve@cyngn.com> | 2016-11-09 01:17:49 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-11-13 23:33:36 -0800 |
commit | f886863e6d8024ef6d2c2712aa518a761fff6b9d (patch) | |
tree | 48e17f4ab5372589629da48779caa04cb66fca8a /src/com/android/camera/VideoUI.java | |
parent | 4538ee80f8a9eb338281db00fb349e111eeb5aaf (diff) | |
download | android_packages_apps_Snap-f886863e6d8024ef6d2c2712aa518a761fff6b9d.tar.gz android_packages_apps_Snap-f886863e6d8024ef6d2c2712aa518a761fff6b9d.tar.bz2 android_packages_apps_Snap-f886863e6d8024ef6d2c2712aa518a761fff6b9d.zip |
snap: Better capture animation
* Modified version from Camera2
* Also adjust the callbacks for better response
Change-Id: I85ac23cdf35d9e2625799dd64b9f86aef103be7b
Diffstat (limited to 'src/com/android/camera/VideoUI.java')
-rw-r--r-- | src/com/android/camera/VideoUI.java | 44 |
1 files changed, 5 insertions, 39 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index 4107af22d..6eff51eeb 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -24,6 +24,7 @@ import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Point; +import android.graphics.RectF; import android.graphics.drawable.ColorDrawable; import android.hardware.Camera.Parameters; import android.hardware.Camera.Face; @@ -99,7 +100,6 @@ public class VideoUI extends BaseUI implements PieRenderer.PieListener, private int mZoomMax; private List<Integer> mZoomRatios; private ImageView mThumbnail; - private View mFlashOverlay; private boolean mOrientationResize; private boolean mPrevOrientationResize; private boolean mIsTimeLapse = false; @@ -112,7 +112,6 @@ public class VideoUI extends BaseUI implements PieRenderer.PieListener, private int mMaxPreviewHeight = 0; private float mAspectRatio = 4f / 3f; private boolean mAspectRatioResize; - private final AnimationManager mAnimationManager; private int mPreviewOrientation = -1; private int mOrientation; @@ -215,7 +214,6 @@ public class VideoUI extends BaseUI implements PieRenderer.PieListener, }); mFocusRing = (FocusRing) mRootView.findViewById(R.id.focus_ring); - mFlashOverlay = mRootView.findViewById(R.id.flash_overlay); mShutterButton = (ShutterButton) mRootView.findViewById(R.id.shutter_button); mMuteButton = (RotateImageView)mRootView.findViewById(R.id.mute_button); @@ -249,7 +247,6 @@ public class VideoUI extends BaseUI implements PieRenderer.PieListener, mFaceView = (FaceView) mRootView.findViewById(R.id.face_view); setSurfaceTextureSizeChangedListener(mFaceView); } - mAnimationManager = new AnimationManager(); mOrientationResize = false; mPrevOrientationResize = false; @@ -456,41 +453,6 @@ public class VideoUI extends BaseUI implements PieRenderer.PieListener, } } - /** - * Starts a flash animation - */ - public void animateFlash() { - mAnimationManager.startFlashAnimation(mFlashOverlay); - } - - /** - * Starts a capture animation - */ - public void animateCapture() { - Bitmap bitmap = null; - animateCapture(bitmap); - } - - /** - * Starts a capture animation - * @param bitmap the captured image that we shrink and slide in the animation - */ - public void animateCapture(Bitmap bitmap) { - if (bitmap == null) { - Log.e(TAG, "No valid bitmap for capture animation."); - return; - } - mActivity.updateThumbnail(bitmap); - mAnimationManager.startCaptureAnimation(mThumbnail); - } - - /** - * Cancels on-going animations - */ - public void cancelAnimations() { - mAnimationManager.cancelAnimations(); - } - public boolean collapseCameraControls() { boolean ret = false; mCameraControls.collapse(); @@ -1066,6 +1028,10 @@ public class VideoUI extends BaseUI implements PieRenderer.PieListener, @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { Log.v(TAG, "surfaceChanged: width = " + width + ", height = " + height); + + RectF r = new RectF(mSurfaceView.getLeft(), mSurfaceView.getTop(), + mSurfaceView.getRight(), mSurfaceView.getBottom()); + onPreviewRectChanged(r); } @Override |