Commit f734509a authored by Jeff Boek's avatar Jeff Boek
Browse files

No Issue - Removes pref, toggles new search based on feature flag only

parent 179a86ce
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import mozilla.components.concept.engine.prompt.ShareData
import mozilla.components.feature.session.SessionFeature
import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
import mozilla.components.support.ktx.kotlin.isUrl
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.NavGraphDirections
import org.mozilla.fenix.R
@@ -79,7 +80,7 @@ class DefaultBrowserToolbarController(
) : BrowserToolbarController {

    private val useNewSearchExperience
        get() = activity.settings().useNewSearchExperience
        get() = FeatureFlags.newSearchExperience

    private val currentSession
        get() = customTabSession ?: activity.components.core.sessionManager.selectedSession
+3 −2
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import mozilla.components.lib.state.ext.consumeFrom
import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
import mozilla.components.support.ktx.android.util.dpToPx
import org.mozilla.fenix.BrowserDirection
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.BrowserAnimator.Companion.getToolbarNavOptions
@@ -444,7 +445,7 @@ class HomeFragment : Fragment() {

        updateTabCounter(requireComponents.core.store.state)

        if (args.focusOnAddressBar && requireContext().settings().useNewSearchExperience) {
        if (args.focusOnAddressBar && FeatureFlags.newSearchExperience) {
            navigateToSearch()
        }
    }
@@ -705,7 +706,7 @@ class HomeFragment : Fragment() {
    }

    private fun navigateToSearch() {
        val directions = if (requireContext().settings().useNewSearchExperience) {
        val directions = if (FeatureFlags.newSearchExperience) {
            HomeFragmentDirections.actionGlobalSearchDialog(
                sessionId = null
            )
+0 −6
Original line number Diff line number Diff line
@@ -25,12 +25,6 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
    override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
        setPreferencesFromResource(R.xml.secret_settings_preferences, rootKey)

        requirePreference<SwitchPreference>(R.string.pref_key_use_new_search_experience).apply {
            isVisible = FeatureFlags.newSearchExperience
            isChecked = context.settings().useNewSearchExperience
            onPreferenceChangeListener = SharedPreferenceUpdater()
        }

        requirePreference<SwitchPreference>(R.string.pref_key_enable_top_frecent_sites).apply {
            isVisible = FeatureFlags.topFrecentSite
            isChecked = context.settings().showTopFrecentSites
+0 −6
Original line number Diff line number Diff line
@@ -98,12 +98,6 @@ class Settings(private val appContext: Context) : PreferencesHolder {
    override val preferences: SharedPreferences =
        appContext.getSharedPreferences(FENIX_PREFERENCES, MODE_PRIVATE)

    var useNewSearchExperience by featureFlagPreference(
        appContext.getPreferenceKey(R.string.pref_key_use_new_search_experience),
        default = false,
        featureFlag = FeatureFlags.newSearchExperience
    )

    var showTopFrecentSites by featureFlagPreference(
        appContext.getPreferenceKey(R.string.pref_key_enable_top_frecent_sites),
        default = false,
+0 −2
Original line number Diff line number Diff line
@@ -181,8 +181,6 @@
    <string name="pref_key_migrating_from_firefox_nightly_tip" translatable="false">pref_key_migrating_from_firefox_nightly_tip</string>
    <string name="pref_key_migrating_from_fenix_tip" translatable="false">pref_key_migrating_from_fenix_tip</string>

    <string name="pref_key_use_new_search_experience" translatable="false">pref_key_use_new_search_experience</string>

    <string name="pref_key_wait_first_paint" translatable="false">pref_key_wait_first_paint</string>

    <string name="pref_key_synced_tabs_tabs_tray" translatable="false">pref_key_synced_tabs_tabs_tray</string>
Loading