For #14933 - Fixed private browsing icon color in preferences fragment

pull/128/head^2
Sören Hentzschel 4 years ago committed by ekager
parent b927b688c9
commit 55b5a452d1

@ -27,6 +27,7 @@ import mozilla.components.concept.sync.AccountObserver
import mozilla.components.concept.sync.AuthType
import mozilla.components.concept.sync.OAuthAccount
import mozilla.components.concept.sync.Profile
import mozilla.components.support.ktx.android.content.getColorFromAttr
import org.mozilla.fenix.BrowserDirection
import org.mozilla.fenix.Config
import org.mozilla.fenix.FeatureFlags
@ -312,6 +313,8 @@ class SettingsFragment : PreferenceFragmentCompat() {
private fun setupPreferences() {
val leakKey = getPreferenceKey(R.string.pref_key_leakcanary)
val debuggingKey = getPreferenceKey(R.string.pref_key_remote_debugging)
val preferencePrivateBrowsing =
requirePreference<Preference>(R.string.pref_key_private_browsing)
val preferenceExternalDownloadManager =
requirePreference<Preference>(R.string.pref_key_external_download_manager)
val preferenceLeakCanary = findPreference<Preference>(leakKey)
@ -319,6 +322,10 @@ class SettingsFragment : PreferenceFragmentCompat() {
val preferenceMakeDefaultBrowser =
requirePreference<Preference>(R.string.pref_key_make_default_browser)
preferencePrivateBrowsing.icon.mutate().apply {
setTint(requireContext().getColorFromAttr(R.attr.primaryText))
}
if (!Config.channel.isReleased) {
preferenceLeakCanary?.setOnPreferenceChangeListener { _, newValue ->
val isEnabled = newValue == true

Loading…
Cancel
Save