2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/15348: Voice search option appears for all search engines

Voice search was restricted only for google, with the condition removed
it should appear now for all search engines
This commit is contained in:
DreVla 2022-12-06 12:26:12 +02:00 committed by mergify[bot]
parent 1c82d1a269
commit 89ce37541b

View File

@ -452,7 +452,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
updateQrButton(it)
}
updateVoiceSearchButton(it)
updateVoiceSearchButton()
}
}
@ -765,15 +765,8 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
searchSelectorAlreadyAdded = true
}
private fun updateVoiceSearchButton(searchFragmentState: SearchFragmentState) {
val searchEngine = searchFragmentState.searchEngineSource.searchEngine
val isVisible =
searchEngine?.id?.contains("google") == true &&
isSpeechAvailable() &&
requireContext().settings().shouldShowVoiceSearch
when (isVisible) {
private fun updateVoiceSearchButton() {
when (isSpeechAvailable() && requireContext().settings().shouldShowVoiceSearch) {
true -> {
if (voiceSearchButtonAction == null) {
voiceSearchButtonAction = IncreasedTapAreaActionDecorator(