From 36ab249924dc43e8a20128076b8e06734095578b Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Fri, 16 Oct 2020 21:37:27 -0400 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/15937 - Remove topFrecentSite feature flag (https://github.com/mozilla-mobile/fenix/pull/15967) * For https://github.com/mozilla-mobile/fenix/issues/15937 - Remove the topFrecentSite feature flag * For https://github.com/mozilla-mobile/fenix/issues/15937 - Hide the "Pull to refresh" preference since its visibility is managed by a feature flag --- app/src/main/java/org/mozilla/fenix/FeatureFlags.kt | 5 ----- .../org/mozilla/fenix/settings/CustomizationFragment.kt | 5 ----- .../org/mozilla/fenix/settings/SecretSettingsFragment.kt | 6 ------ app/src/main/java/org/mozilla/fenix/utils/Settings.kt | 5 ++--- app/src/main/res/values/preference_keys.xml | 1 - app/src/main/res/values/static_strings.xml | 2 -- app/src/main/res/xml/customization_preferences.xml | 9 ++++----- app/src/main/res/xml/secret_settings_preferences.xml | 5 ----- 8 files changed, 6 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt b/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt index 0a0641ea40..5df7c18958 100644 --- a/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt +++ b/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt @@ -21,11 +21,6 @@ object FeatureFlags { */ val syncedTabsInTabsTray = Config.channel.isNightlyOrDebug - /** - * Enables showing the top frequently visited sites - */ - const val topFrecentSite = true - /** * Shows the grid view settings for the tabs tray. */ diff --git a/app/src/main/java/org/mozilla/fenix/settings/CustomizationFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/CustomizationFragment.kt index be37bcd1be..c54f04c1b3 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/CustomizationFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/CustomizationFragment.kt @@ -9,7 +9,6 @@ import android.os.Build import android.os.Build.VERSION.SDK_INT import android.os.Bundle import androidx.appcompat.app.AppCompatDelegate -import androidx.preference.PreferenceCategory import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference import org.mozilla.fenix.FeatureFlags @@ -136,11 +135,7 @@ class CustomizationFragment : PreferenceFragmentCompat() { } private fun setupHomeCategory() { - requirePreference(R.string.pref_home_category).apply { - isVisible = FeatureFlags.topFrecentSite - } requirePreference(R.string.pref_key_enable_top_frecent_sites).apply { - isVisible = FeatureFlags.topFrecentSite isChecked = context.settings().showTopFrecentSites onPreferenceChangeListener = SharedPreferenceUpdater() } diff --git a/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt index 3dcd31e597..aa4c7503d8 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt @@ -31,12 +31,6 @@ class SecretSettingsFragment : PreferenceFragmentCompat() { onPreferenceChangeListener = SharedPreferenceUpdater() } - requirePreference(R.string.pref_key_enable_top_frecent_sites).apply { - isVisible = FeatureFlags.topFrecentSite - isChecked = context.settings().showTopFrecentSites - onPreferenceChangeListener = SharedPreferenceUpdater() - } - requirePreference(R.string.pref_key_wait_first_paint).apply { isVisible = FeatureFlags.waitUntilPaintToDraw isChecked = context.settings().waitToShowPageUntilFirstPaint diff --git a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt index 6c411abed9..57159ab1dd 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -100,10 +100,9 @@ class Settings(private val appContext: Context) : PreferencesHolder { override val preferences: SharedPreferences = appContext.getSharedPreferences(FENIX_PREFERENCES, MODE_PRIVATE) - var showTopFrecentSites by featureFlagPreference( + var showTopFrecentSites by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_enable_top_frecent_sites), - default = true, - featureFlag = FeatureFlags.topFrecentSite + default = true ) var numberOfAppLaunches by intPreference( diff --git a/app/src/main/res/values/preference_keys.xml b/app/src/main/res/values/preference_keys.xml index 63ec9a704a..a2ba564776 100644 --- a/app/src/main/res/values/preference_keys.xml +++ b/app/src/main/res/values/preference_keys.xml @@ -128,7 +128,6 @@ pref_key_follow_device_theme - pref_home_category pref_key_website_pull_to_refresh pref_key_dynamic_toolbar pref_key_swipe_toolbar_switch_tabs diff --git a/app/src/main/res/values/static_strings.xml b/app/src/main/res/values/static_strings.xml index e8fa3a8fc2..51c58369f0 100644 --- a/app/src/main/res/values/static_strings.xml +++ b/app/src/main/res/values/static_strings.xml @@ -34,8 +34,6 @@ Secret Settings Show Grid View in Tabs Settings - - Show Top Frequently Visited Sites Wait Until First Paint To Show Page Content diff --git a/app/src/main/res/xml/customization_preferences.xml b/app/src/main/res/xml/customization_preferences.xml index 10a203c79c..569da603d9 100644 --- a/app/src/main/res/xml/customization_preferences.xml +++ b/app/src/main/res/xml/customization_preferences.xml @@ -46,12 +46,10 @@ + app:iconSpaceReserved="false"> @@ -64,7 +62,8 @@ app:iconSpaceReserved="false"> + android:title="@string/preference_gestures_website_pull_to_refresh" + app:isPreferenceVisible="false" /> @@ -74,6 +73,6 @@ + app:isPreferenceVisible="false" /> diff --git a/app/src/main/res/xml/secret_settings_preferences.xml b/app/src/main/res/xml/secret_settings_preferences.xml index f5d8b26cf3..8b53b5e22d 100644 --- a/app/src/main/res/xml/secret_settings_preferences.xml +++ b/app/src/main/res/xml/secret_settings_preferences.xml @@ -9,11 +9,6 @@ android:key="@string/pref_key_show_grid_view_tabs_settings" android:title="@string/preferences_debug_settings_show_grid_view_tabs_settings" app:iconSpaceReserved="false" /> -