Bug 1815968 - Add secret setting to Tabs Tray to Compose rewrite

fenix/112.0
Noah Bond 1 year ago committed by mergify[bot]
parent c1923291d3
commit 33737d4d90

@ -55,7 +55,7 @@ object FeatureFlags {
/**
* Enables compose on the tabs tray items.
*/
val composeTabsTray = Config.channel.isDebug
const val composeTabsTray = false
/**
* Enables the wallpaper v2 enhancements.

@ -59,6 +59,12 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
onPreferenceChangeListener = SharedPreferenceUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_tabs_tray_to_compose).apply {
isVisible = Config.channel.isNightlyOrDebug
isChecked = context.settings().enableTabsTrayToCompose
onPreferenceChangeListener = SharedPreferenceUpdater()
}
// for performance reasons, this is only available in Nightly or Debug builds
requirePreference<EditTextPreference>(R.string.pref_key_custom_glean_server_url).apply {
isVisible = Config.channel.isNightlyOrDebug && BuildConfig.GLEAN_CUSTOM_URL.isNullOrEmpty()

@ -16,7 +16,6 @@ import mozilla.components.browser.tabstray.SelectableTabViewHolder
import mozilla.components.browser.tabstray.TabsAdapter.Companion.PAYLOAD_DONT_HIGHLIGHT_SELECTED_ITEM
import mozilla.components.browser.tabstray.TabsAdapter.Companion.PAYLOAD_HIGHLIGHT_SELECTED_ITEM
import mozilla.components.browser.thumbnails.loader.ThumbnailLoader
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.components.Components
import org.mozilla.fenix.databinding.TabTrayGridItemBinding
import org.mozilla.fenix.databinding.TabTrayItemBinding
@ -65,14 +64,14 @@ class BrowserTabsAdapter(
override fun getItemViewType(position: Int): Int {
return when {
context.components.settings.gridTabView -> {
if (FeatureFlags.composeTabsTray) {
if (context.components.settings.enableTabsTrayToCompose) {
ViewType.COMPOSE_GRID.layoutRes
} else {
ViewType.GRID.layoutRes
}
}
else -> {
if (FeatureFlags.composeTabsTray) {
if (context.components.settings.enableTabsTrayToCompose) {
ViewType.COMPOSE_LIST.layoutRes
} else {
ViewType.LIST.layoutRes

@ -1607,4 +1607,12 @@ class Settings(private val appContext: Context) : PreferencesHolder {
key = appContext.getPreferenceKey(R.string.pref_key_growth_uri_load_last_sent),
default = 0,
)
/**
* Indicates if the Tabs Tray to Compose changes are enabled.
*/
var enableTabsTrayToCompose by booleanPreference(
key = appContext.getPreferenceKey(R.string.pref_key_enable_tabs_tray_to_compose),
default = FeatureFlags.composeTabsTray,
)
}

@ -296,6 +296,8 @@
<string name="pref_key_camera_permissions_needed" translatable="false">pref_key_camera_permissions_needed</string>
<string name="pref_key_inactive_tabs_category" translatable="false">pref_key_inactive_tabs_category</string>
<string name="pref_key_inactive_tabs" translatable="false">pref_key_inactive_tabs</string>
<!-- Whether or not the Tabs Tray to Compose changes are shown -->
<string name="pref_key_enable_tabs_tray_to_compose" translatable="false">pref_key_enable_tabs_tray_to_compose</string>
<string name="pref_key_return_to_browser" translatable="false">pref_key_return_to_browser</string>

@ -64,6 +64,8 @@
<string name="preferences_sync_debug_quit_button_title">Stop Firefox</string>
<!-- Quit app button summary for the Sync Debug preferences -->
<string name="preferences_sync_debug_quit_button_summary">Custom server changes will take effect on the next Firefox run.</string>
<!-- Label for enabling the Tabs Tray to Compose changes -->
<string name="preferences_debug_settings_tabs_tray_to_compose" translatable="false">Enable Tabs Tray to Compose rewrite</string>
<!-- A secret menu option in the tabs tray for making a tab inactive for testing. -->
<string name="inactive_tabs_menu_item">Make inactive</string>

@ -25,6 +25,11 @@
android:key="@string/pref_key_show_unified_search"
android:title="@string/preferences_debug_settings_unified_search"
app:iconSpaceReserved="false" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/pref_key_enable_tabs_tray_to_compose"
android:title="@string/preferences_debug_settings_tabs_tray_to_compose"
app:iconSpaceReserved="false" />
<EditTextPreference
android:key="@string/pref_key_custom_glean_server_url"
android:title="@string/preferences_debug_settings_custom_glean_server_url"

Loading…
Cancel
Save