Hide voice search in drawer qsb on invalid intent

This commit fixes an issue where the mic icon shows up when the search bar text has been changed, even with an invalid intent.
This commit is contained in:
SuperDragonXD
2024-08-06 22:55:30 +08:00
committed by GitHub
parent 7ac7392080
commit c3efe1a530
@@ -128,7 +128,7 @@ class AllAppsSearchInput(context: Context, attrs: AttributeSet?) :
}
addTextChangedListener {
actionButton.isVisible = !it.isNullOrEmpty()
micIcon.isVisible = shouldShowIcons && it.isNullOrEmpty()
micIcon.isVisible = shouldShowIcons && voiceIntent != null && it.isNullOrEmpty()
lensIcon.isVisible = shouldShowIcons && supportsLens && lensIntent != null && it.isNullOrEmpty()
}
}