mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 21:15:30 +03:00
make sure to torn of torch after taking a picture
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
dd9501590b
commit
d0f52c8eba
2 changed files with 7 additions and 0 deletions
|
@ -324,6 +324,7 @@ public class TakePhotoActivity extends AppCompatActivity {
|
|||
|
||||
binding.photoPreview.setImageBitmap(bitmap);
|
||||
binding.photoPreview.setTag(savedUri);
|
||||
viewModel.disableTorchIfEnabled();
|
||||
}
|
||||
|
||||
public int getImageOrientation(File imageFile) {
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue