* For #1063 - Adds feature flag and pref for new tab tray * For #1063 - Swaps add tab to tab tray button when newTabTray is enabled * For #1063 - Creates hidden preference to use new tab tray * For #1063 - Hides tabs on home screen when setting is enabled * For #1063 - Navigate to new tab tray from browser with setting enabled * For #1063 - Fixes regression where we dont show the new tab message with no tabs and no collections * For #1063 - Fixes crash when toggling to private mode on the home screen * For #1063 - combines both settings. Cleans up lint errorsfennec/production
parent
f7dcb9f7b3
commit
a8a90bd4d6
@ -0,0 +1,35 @@
|
|||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
package org.mozilla.fenix.settings
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import androidx.preference.SwitchPreference
|
||||||
|
import org.mozilla.fenix.R
|
||||||
|
import org.mozilla.fenix.ext.getPreferenceKey
|
||||||
|
import org.mozilla.fenix.ext.settings
|
||||||
|
import org.mozilla.fenix.ext.showToolbar
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lets the user customize Private browsing options.
|
||||||
|
*/
|
||||||
|
class SecretSettingsPreference : PreferenceFragmentCompat() {
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
showToolbar(getString(R.string.preferences_debug_settings))
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
setPreferencesFromResource(R.xml.secret_settings_preferences, rootKey)
|
||||||
|
updatePreferences()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updatePreferences() {
|
||||||
|
findPreference<SwitchPreference>(getPreferenceKey(R.string.pref_key_enable_new_tab_tray))?.apply {
|
||||||
|
onPreferenceChangeListener = SharedPreferenceUpdater()
|
||||||
|
isChecked = context.settings().useNewTabTray
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
- 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_enable_new_tab_tray"
|
||||||
|
android:title="@string/preferences_debug_settings_enable_tab_tray"
|
||||||
|
app:iconSpaceReserved="false" />
|
||||||
|
</PreferenceScreen>
|
Loading…
Reference in New Issue