properly hide flash

This commit is contained in:
darthpaul 2022-08-19 00:18:00 +01:00
parent 22df3d8c58
commit 4b7166e90f
2 changed files with 10 additions and 2 deletions

View File

@ -514,7 +514,7 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
if (available) {
toggle_flash.beVisible()
} else {
toggle_flash.beInvisible()
toggle_flash.beGone()
toggle_flash.setImageResource(R.drawable.ic_flash_off_vector)
mPreview?.setFlashlightState(FLASH_OFF)
}

View File

@ -35,11 +35,13 @@
android:id="@+id/toggle_photo_video"
android:layout_width="@dimen/icon_size"
android:layout_height="@dimen/icon_size"
android:layout_marginStart="@dimen/normal_margin"
android:layout_marginEnd="@dimen/normal_margin"
android:contentDescription="@string/toggle_photo_video"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_video_vector"
app:layout_constraintEnd_toStartOf="@id/toggle_flash"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@ -47,6 +49,8 @@
android:id="@+id/toggle_flash"
android:layout_width="@dimen/icon_size"
android:layout_height="@dimen/icon_size"
android:layout_marginStart="@dimen/normal_margin"
android:layout_marginEnd="@dimen/normal_margin"
android:layout_weight="1"
android:contentDescription="@string/toggle_flash"
android:padding="@dimen/normal_margin"
@ -62,6 +66,8 @@
android:layout_height="@dimen/icon_size"
android:layout_below="@+id/toggle_photo_video"
android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/normal_margin"
android:layout_marginEnd="@dimen/normal_margin"
android:contentDescription="@string/resolution"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_resolution_vector"
@ -73,6 +79,8 @@
android:id="@+id/settings"
android:layout_width="@dimen/icon_size"
android:layout_height="@dimen/icon_size"
android:layout_marginStart="@dimen/normal_margin"
android:layout_marginEnd="@dimen/normal_margin"
android:contentDescription="@string/settings"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_settings_cog_vector"