diff --git a/app/src/main/java/com/nextcloud/talk/activities/TakePhotoActivity.java b/app/src/main/java/com/nextcloud/talk/activities/TakePhotoActivity.java index f91bb15b8..f13011ef7 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/TakePhotoActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/TakePhotoActivity.java @@ -324,6 +324,7 @@ public class TakePhotoActivity extends AppCompatActivity { binding.photoPreview.setImageBitmap(bitmap); binding.photoPreview.setTag(savedUri); + viewModel.disableTorchIfEnabled(); } public int getImageOrientation(File imageFile) { diff --git a/app/src/main/java/com/nextcloud/talk/models/TakePictureViewModel.java b/app/src/main/java/com/nextcloud/talk/models/TakePictureViewModel.java index 44d12e8ce..39c009773 100644 --- a/app/src/main/java/com/nextcloud/talk/models/TakePictureViewModel.java +++ b/app/src/main/java/com/nextcloud/talk/models/TakePictureViewModel.java @@ -64,6 +64,12 @@ public class TakePictureViewModel extends ViewModel { } } + public void disableTorchIfEnabled() { + if (this.torchEnabled.getValue()) { + toggleTorchEnabled(); + } + } + public void toggleTorchEnabled() { //noinspection ConstantConditions this.torchEnabled.postValue(!this.torchEnabled.getValue());