Change icon of mode button when switching between photo & video mode

This commit is contained in:
Matéo Duparc 2022-01-11 20:18:02 +01:00
parent 23d017780f
commit 5d6f53b37a
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E
5 changed files with 7 additions and 3 deletions

View File

@ -226,11 +226,15 @@ class CameraActivity : BaseActivity(), SensorOrientationListener.Listener {
requestPermissions(arrayOf(Manifest.permission.RECORD_AUDIO), AUDIO_PERMISSION_REQUEST_CODE)
}
}
binding.imageModeSwitch.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.icon_photo)?.also {
it.setTint(ContextCompat.getColor(this, R.color.neutralIconTint))
})
imageCapture?.flashMode = ImageCapture.FLASH_MODE_OFF
R.drawable.icon_flash_off
} else {
binding.recordVideoButton.visibility = View.GONE
binding.takePhotoButton.visibility = View.VISIBLE
binding.imageModeSwitch.setImageResource(R.drawable.icon_video)
imageCapture?.flashMode = ImageCapture.FLASH_MODE_AUTO
R.drawable.icon_flash_auto
})

View File

@ -481,7 +481,7 @@ open class BaseExplorerActivity : BaseActivity() {
menu.findItem(R.id.external_open)?.isVisible = false
}
val noItemSelected = explorerAdapter.selectedItems.isEmpty()
val iconColor = ContextCompat.getColor(this, R.color.menuIconTint)
val iconColor = ContextCompat.getColor(this, R.color.neutralIconTint)
setMenuIconTint(menu, iconColor, R.id.sort, R.drawable.icon_sort)
setMenuIconTint(menu, iconColor, R.id.delete, R.drawable.icon_delete)
setMenuIconTint(menu, iconColor, R.id.decrypt, R.drawable.icon_decrypt)

View File

@ -171,7 +171,7 @@ class ExplorerActivity : BaseExplorerActivity() {
listOf("importFolder", R.string.import_folder, R.drawable.icon_import_folder),
listOf("createFile", R.string.new_file, R.drawable.icon_file_unknown),
listOf("createFolder", R.string.mkdir, R.drawable.icon_create_new_folder),
listOf("camera", R.string.camera, R.drawable.icon_camera)
listOf("camera", R.string.camera, R.drawable.icon_photo)
)
CustomAlertDialogBuilder(this, themeValue)
.setSingleChoiceItems(adapter, -1){ thisDialog, which ->

View File

@ -9,7 +9,7 @@
<color name="yellow">#FFD600</color>
<color name="orange">#FF6D00</color>
<color name="purple">#AA00FF</color>
<color name="menuIconTint">@color/white</color>
<color name="neutralIconTint">@color/white</color>
<color name="fullScreenBackgroundColor">@color/black</color>
<color name="textColor">@color/white</color>
<color name="itemSelected">#66666666</color>