2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

Revert "For #15761 - [Grid View] Enable the grid view and remove its feature flag (#16535)" (#16544)

This reverts commit 7499d33b32.
This commit is contained in:
Gabriel Luong 2020-11-12 17:17:36 -05:00 committed by GitHub
parent 409041ae3b
commit e9d335cb24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 35 additions and 1 deletions

View File

@ -21,6 +21,11 @@ object FeatureFlags {
*/
val syncedTabsInTabsTray = Config.channel.isNightlyOrDebug
/**
* Shows the grid view settings for the tabs tray.
*/
val showGridViewInTabsSettings = Config.channel.isNightlyOrDebug
/**
* Enables downloads with external download managers.
*/

View File

@ -25,6 +25,12 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.secret_settings_preferences, rootKey)
requirePreference<SwitchPreference>(R.string.pref_key_show_grid_view_tabs_settings).apply {
isVisible = FeatureFlags.showGridViewInTabsSettings
isChecked = context.settings().showGridViewInTabsSettings
onPreferenceChangeListener = SharedPreferenceUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_synced_tabs_tabs_tray).apply {
isVisible = FeatureFlags.syncedTabsInTabsTray
isChecked = context.settings().syncedTabsInTabsTray

View File

@ -6,10 +6,12 @@ package org.mozilla.fenix.settings
import android.os.Bundle
import android.view.View
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.showToolbar
import org.mozilla.fenix.utils.view.addToRadioGroup
@ -49,6 +51,10 @@ class TabsSettingsFragment : PreferenceFragmentCompat() {
radioOneMonth = requirePreference(R.string.pref_key_close_tabs_after_one_month)
setupRadioGroups()
requirePreference<PreferenceCategory>(R.string.pref_key_tab_view_category).apply {
isVisible = context.settings().showGridViewInTabsSettings
}
}
private fun setupRadioGroups() {

View File

@ -123,6 +123,12 @@ class Settings(private val appContext: Context) : PreferencesHolder {
val canShowCfr: Boolean
get() = (System.currentTimeMillis() - lastCfrShownTimeInMillis) > THREE_DAYS_MS
var showGridViewInTabsSettings by featureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_show_grid_view_tabs_settings),
default = Config.channel.isNightlyOrDebug,
featureFlag = FeatureFlags.showGridViewInTabsSettings
)
var syncedTabsInTabsTray by featureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_synced_tabs_tabs_tray),
default = false,

View File

@ -220,6 +220,7 @@
<string name="pref_key_show_collections_placeholder_home" translatable="false">pref_key_show_collections_home</string>
<!-- Tabs Settings -->
<string name="pref_key_tab_view_category" translatable="false">pref_key_tab_view_category</string>
<string name="pref_key_tab_view_list" translatable="false">pref_key_tab_view_list</string>
<string name="pref_key_tab_view_grid" translatable="false">pref_key_tab_view_grid</string>
<string name="pref_key_tabs" translatable="false">pref_key_tabs</string>
@ -227,6 +228,7 @@
<string name="pref_key_close_tabs_after_one_day" translatable="false">pref_key_close_tabs_after_one_day</string>
<string name="pref_key_close_tabs_after_one_week" translatable="false">pref_key_close_tabs_after_one_week</string>
<string name="pref_key_close_tabs_after_one_month" translatable="false">pref_key_close_tabs_after_one_month</string>
<string name="pref_key_show_grid_view_tabs_settings" translatable="false">pref_key_show_grid_view_tabs_settings</string>
<string name="pref_key_camera_permissions_needed" translatable="false">pref_key_camera_permissions_needed</string>

View File

@ -32,6 +32,8 @@
<!-- Label for the secret settings preference -->
<string name="preferences_debug_settings">Secret Settings</string>
<!-- Label for the show grid view in tabs setting preference -->
<string name="preferences_debug_settings_show_grid_view_tabs_settings">Show Grid View in Tabs Settings</string>
<!-- Label for showing Synced Tabs in the tabs tray -->
<string name="preferences_debug_synced_tabs_tabs_tray">Show Synced Tabs in the tabs tray</string>

View File

@ -4,6 +4,11 @@
- 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_show_grid_view_tabs_settings"
android:title="@string/preferences_debug_settings_show_grid_view_tabs_settings"
app:iconSpaceReserved="false" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/pref_key_synced_tabs_tabs_tray"

View File

@ -5,10 +5,12 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.preference.PreferenceCategory
android:key="@string/pref_key_tab_view_category"
android:layout="@layout/preference_cat_style"
android:title="@string/preferences_tab_view"
app:allowDividerAbove="false"
app:iconSpaceReserved="false">
app:iconSpaceReserved="false"
app:isPreferenceVisible="false">
<org.mozilla.fenix.settings.RadioButtonPreference
android:defaultValue="true"
android:key="@string/pref_key_tab_view_list"