For #1216: Put voice search behind a nightly & debug flag
This commit is contained in:
parent
d33edd8841
commit
535e020683
|
@ -48,4 +48,9 @@ object FeatureFlags {
|
|||
* Enables new tab tray pref
|
||||
*/
|
||||
val tabTray = Config.channel.isNightlyOrDebug
|
||||
|
||||
/**
|
||||
* Enables new voice search feature
|
||||
*/
|
||||
val voiceSearch = Config.channel.isNightlyOrDebug
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ import mozilla.components.ui.autocomplete.InlineAutocompleteEditText
|
|||
import org.mozilla.fenix.BrowserDirection
|
||||
import org.mozilla.fenix.HomeActivity
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.FeatureFlags
|
||||
import org.mozilla.fenix.components.StoreProvider
|
||||
import org.mozilla.fenix.components.metrics.Event
|
||||
import org.mozilla.fenix.ext.components
|
||||
|
@ -138,7 +139,7 @@ class SearchFragment : Fragment(), UserInteractionHandler {
|
|||
BrowserToolbar.Button(
|
||||
ContextCompat.getDrawable(requireContext(), R.drawable.ic_microphone)!!,
|
||||
requireContext().getString(R.string.voice_search_content_description),
|
||||
visible = { requireContext().settings().shouldShowVoiceSearch },
|
||||
visible = { requireContext().settings().shouldShowVoiceSearch && FeatureFlags.voiceSearch },
|
||||
listener = ::launchVoiceSearch
|
||||
)
|
||||
)
|
||||
|
@ -311,7 +312,7 @@ class SearchFragment : Fragment(), UserInteractionHandler {
|
|||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
|
||||
if (requestCode == 0 && resultCode == RESULT_OK) {
|
||||
if (requestCode == SPEECH_REQUEST_CODE && resultCode == RESULT_OK) {
|
||||
intent?.getStringArrayListExtra(EXTRA_RESULTS)?.first()?.also {
|
||||
toolbarView.view.edit.updateUrl(url = it, shouldHighlight = true)
|
||||
searchInteractor.onTextChanged(it)
|
||||
|
|
|
@ -10,6 +10,7 @@ import androidx.preference.CheckBoxPreference
|
|||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import androidx.preference.SwitchPreference
|
||||
import org.mozilla.fenix.FeatureFlags
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.ext.getPreferenceKey
|
||||
import org.mozilla.fenix.ext.settings
|
||||
|
@ -62,6 +63,7 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
|
|||
|
||||
val showVoiceSearchPreference =
|
||||
findPreference<SwitchPreference>(getPreferenceKey(R.string.pref_key_show_voice_search))?.apply {
|
||||
isVisible = FeatureFlags.voiceSearch
|
||||
isChecked = context.settings().shouldShowVoiceSearch
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user