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

pull/35/head
Jeff Boek 4 years ago
parent 179a86ce64
commit f734509ac4

@ -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

@ -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
)

@ -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

@ -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,

@ -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>

@ -32,8 +32,6 @@
<!-- Label for the secret settings preference -->
<string name="preferences_debug_settings">Secret Settings</string>
<!-- Label for the new search experience preference -->
<string name="preferences_debug_settings_use_new_search_experience">Use New Search Experience</string>
<!-- Label for the show top frequently visited sites preference -->
<string name="preferences_debug_settings_enable_top_frecent_sites">Show Top Frequently Visited Sites</string>
<!-- Label for the wait until first paint preference -->

@ -4,11 +4,6 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<SwitchPreference
android:defaultValue="false"
android:key="@string/pref_key_use_new_search_experience"
android:title="@string/preferences_debug_settings_use_new_search_experience"
app:iconSpaceReserved="false" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/pref_key_enable_top_frecent_sites"

Loading…
Cancel
Save