show shutter animation along with sound

This commit is contained in:
darthpaul
2022-10-11 00:24:41 +01:00
parent 375bce1163
commit ac3044f52b
3 changed files with 7 additions and 2 deletions

View File

@@ -423,6 +423,7 @@ class CameraXPreview(
val mediaOutput = mediaOutputHelper.getImageMediaOutput()
imageCapture.takePicture(mainExecutor, object : OnImageCapturedCallback() {
override fun onCaptureSuccess(image: ImageProxy) {
listener.shutterAnimation()
playShutterSoundIfEnabled()
ensureBackgroundThread {
image.use {

View File

@@ -10,6 +10,7 @@ interface CameraXPreviewListener {
fun setFlashAvailable(available: Boolean)
fun onChangeCamera(frontCamera: Boolean)
fun toggleBottomButtons(hide: Boolean)
fun shutterAnimation()
fun onMediaSaved(uri: Uri)
fun onImageCaptured(bitmap: Bitmap)
fun onChangeFlashMode(flashMode: Int)