diff --git a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt index 7c538047b..7a92205f8 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -33,6 +33,7 @@ import mozilla.components.browser.session.Session import mozilla.components.browser.session.SessionManager import mozilla.components.browser.session.runWithSessionIdOrSelected import mozilla.components.concept.engine.prompt.ShareData +import mozilla.components.feature.accounts.FxaCapability import mozilla.components.feature.accounts.FxaWebChannelFeature import mozilla.components.feature.app.links.AppLinksFeature import mozilla.components.feature.contextmenu.ContextMenuCandidate @@ -481,8 +482,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session view.swipeRefresh.setOnChildScrollUpCallback { _, _ -> true } } - // @Suppress("ConstantConditionIf") - /* + @Suppress("ConstantConditionIf") if (!FeatureFlags.asFeatureWebChannelsDisabled) { webchannelIntegration.set( feature = FxaWebChannelFeature( @@ -499,8 +499,6 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session ) } - */ - initializeEngineView(toolbarHeight) } } diff --git a/app/src/main/java/org/mozilla/fenix/search/SearchFragment.kt b/app/src/main/java/org/mozilla/fenix/search/SearchFragment.kt index 2b97ade35..20be7dfca 100644 --- a/app/src/main/java/org/mozilla/fenix/search/SearchFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/search/SearchFragment.kt @@ -64,6 +64,14 @@ class SearchFragment : Fragment(), UserInteractionHandler { private lateinit var searchStore: SearchFragmentStore private lateinit var searchInteractor: SearchInteractor + private fun shouldShowSearchSuggestions(isPrivate: Boolean): Boolean = + if (isPrivate) { + requireContext().settings().shouldShowSearchSuggestions && + requireContext().settings().shouldShowSearchSuggestionsInPrivate + } else { + requireContext().settings().shouldShowSearchSuggestions + } + override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -85,21 +93,13 @@ class SearchFragment : Fragment(), UserInteractionHandler { requireComponents.analytics.metrics.track(Event.InteractWithSearchURLArea) - val showSearchSuggestions = - if (isPrivate) { - requireContext().settings().shouldShowSearchSuggestions && - requireContext().settings().shouldShowSearchSuggestionsInPrivate - } else { - requireContext().settings().shouldShowSearchSuggestions - } - searchStore = StoreProvider.get(this) { SearchFragmentStore( SearchFragmentState( query = url, searchEngineSource = currentSearchEngine, defaultEngineSource = currentSearchEngine, - showSearchSuggestions = showSearchSuggestions, + showSearchSuggestions = shouldShowSearchSuggestions(isPrivate), showSearchSuggestionsHint = false, showSearchShortcuts = requireContext().settings().shouldShowSearchShortcuts && url.isEmpty(), showClipboardSuggestions = requireContext().settings().shouldShowClipboardSuggestions, @@ -142,6 +142,7 @@ class SearchFragment : Fragment(), UserInteractionHandler { listener = ::launchVoiceSearch ) ) + val urlView = toolbarView.view .findViewById(R.id.mozac_browser_toolbar_edit_url_view) urlView?.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO