From 5d6f53b37a637d604c16a3c92ec1a3fcf2ec3598 Mon Sep 17 00:00:00 2001 From: Hardcore Sushi Date: Tue, 11 Jan 2022 20:18:02 +0100 Subject: [PATCH] Change icon of mode button when switching between photo & video mode --- app/src/main/java/sushi/hardcore/droidfs/CameraActivity.kt | 4 ++++ .../sushi/hardcore/droidfs/explorers/BaseExplorerActivity.kt | 2 +- .../java/sushi/hardcore/droidfs/explorers/ExplorerActivity.kt | 2 +- app/src/main/res/drawable/{icon_camera.xml => icon_photo.xml} | 0 app/src/main/res/values/colors.xml | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) rename app/src/main/res/drawable/{icon_camera.xml => icon_photo.xml} (100%) diff --git a/app/src/main/java/sushi/hardcore/droidfs/CameraActivity.kt b/app/src/main/java/sushi/hardcore/droidfs/CameraActivity.kt index a911f52..c53d161 100644 --- a/app/src/main/java/sushi/hardcore/droidfs/CameraActivity.kt +++ b/app/src/main/java/sushi/hardcore/droidfs/CameraActivity.kt @@ -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 }) diff --git a/app/src/main/java/sushi/hardcore/droidfs/explorers/BaseExplorerActivity.kt b/app/src/main/java/sushi/hardcore/droidfs/explorers/BaseExplorerActivity.kt index d0509d6..293a4fa 100644 --- a/app/src/main/java/sushi/hardcore/droidfs/explorers/BaseExplorerActivity.kt +++ b/app/src/main/java/sushi/hardcore/droidfs/explorers/BaseExplorerActivity.kt @@ -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) diff --git a/app/src/main/java/sushi/hardcore/droidfs/explorers/ExplorerActivity.kt b/app/src/main/java/sushi/hardcore/droidfs/explorers/ExplorerActivity.kt index 9a90398..a9cd235 100644 --- a/app/src/main/java/sushi/hardcore/droidfs/explorers/ExplorerActivity.kt +++ b/app/src/main/java/sushi/hardcore/droidfs/explorers/ExplorerActivity.kt @@ -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 -> diff --git a/app/src/main/res/drawable/icon_camera.xml b/app/src/main/res/drawable/icon_photo.xml similarity index 100% rename from app/src/main/res/drawable/icon_camera.xml rename to app/src/main/res/drawable/icon_photo.xml diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 81df520..d67ee5f 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -9,7 +9,7 @@ #FFD600 #FF6D00 #AA00FF - @color/white + @color/white @color/black @color/white #66666666