|
|
@ -22,6 +22,7 @@ import androidx.preference.Preference
|
|
|
|
import androidx.preference.Preference.OnPreferenceClickListener
|
|
|
|
import androidx.preference.Preference.OnPreferenceClickListener
|
|
|
|
import androidx.preference.PreferenceCategory
|
|
|
|
import androidx.preference.PreferenceCategory
|
|
|
|
import androidx.preference.PreferenceFragmentCompat
|
|
|
|
import androidx.preference.PreferenceFragmentCompat
|
|
|
|
|
|
|
|
import androidx.preference.SwitchPreference
|
|
|
|
import kotlinx.coroutines.launch
|
|
|
|
import kotlinx.coroutines.launch
|
|
|
|
import mozilla.components.concept.sync.AccountObserver
|
|
|
|
import mozilla.components.concept.sync.AccountObserver
|
|
|
|
import mozilla.components.concept.sync.AuthType
|
|
|
|
import mozilla.components.concept.sync.AuthType
|
|
|
@ -44,6 +45,7 @@ import org.mozilla.fenix.R.string.pref_key_delete_browsing_data
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_delete_browsing_data_on_quit_preference
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_delete_browsing_data_on_quit_preference
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_help
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_help
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_language
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_language
|
|
|
|
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_launch_links_in_private_mode
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_leakcanary
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_leakcanary
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_make_default_browser
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_make_default_browser
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_privacy_link
|
|
|
|
import org.mozilla.fenix.R.string.pref_key_privacy_link
|
|
|
@ -248,10 +250,19 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver {
|
|
|
|
val makeDefaultBrowserKey = getPreferenceKey(pref_key_make_default_browser)
|
|
|
|
val makeDefaultBrowserKey = getPreferenceKey(pref_key_make_default_browser)
|
|
|
|
val leakKey = getPreferenceKey(pref_key_leakcanary)
|
|
|
|
val leakKey = getPreferenceKey(pref_key_leakcanary)
|
|
|
|
val debuggingKey = getPreferenceKey(pref_key_remote_debugging)
|
|
|
|
val debuggingKey = getPreferenceKey(pref_key_remote_debugging)
|
|
|
|
|
|
|
|
val preferenceAlwaysOpenInPrivateModeKey = getPreferenceKey(
|
|
|
|
|
|
|
|
pref_key_launch_links_in_private_mode
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
val preferenceMakeDefaultBrowser = findPreference<Preference>(makeDefaultBrowserKey)
|
|
|
|
val preferenceMakeDefaultBrowser = findPreference<Preference>(makeDefaultBrowserKey)
|
|
|
|
val preferenceLeakCanary = findPreference<Preference>(leakKey)
|
|
|
|
val preferenceLeakCanary = findPreference<Preference>(leakKey)
|
|
|
|
val preferenceRemoteDebugging = findPreference<Preference>(debuggingKey)
|
|
|
|
val preferenceRemoteDebugging = findPreference<Preference>(debuggingKey)
|
|
|
|
|
|
|
|
val preferenceAlwaysOpenInPrivateMode = findPreference<SwitchPreference>(preferenceAlwaysOpenInPrivateModeKey)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
preferenceAlwaysOpenInPrivateMode?.setOnPreferenceClickListener {
|
|
|
|
|
|
|
|
requireContext().settings.alwaysOpenInPrivateMode = !requireContext().settings.alwaysOpenInPrivateMode
|
|
|
|
|
|
|
|
true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
preferenceMakeDefaultBrowser?.onPreferenceClickListener =
|
|
|
|
preferenceMakeDefaultBrowser?.onPreferenceClickListener =
|
|
|
|
getClickListenerForMakeDefaultBrowser()
|
|
|
|
getClickListenerForMakeDefaultBrowser()
|
|
|
|