[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-148.0a1-16.0-2] fixup! [android] Modify UI/UX



Title: GitLab

clairehurst pushed to branch tor-browser-148.0a1-16.0-2 at The Tor Project / Applications / Tor Browser

Commits:

  • f48e0883
    by clairehurst at 2026-03-02T11:20:17-08:00
    fixup! [android] Modify UI/UX
    
    TB 44274
    Re-adds screenshot setting to our custom location. It was removed upstream in 144 and re-added in 145, but not in the place we want it
    

2 changed files:

Changes:

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
    ... ... @@ -80,6 +80,8 @@ import org.mozilla.fenix.utils.Settings
    80 80
     import kotlin.system.exitProcess
    
    81 81
     import org.mozilla.fenix.GleanMetrics.Settings as SettingsMetrics
    
    82 82
     
    
    83
    +import android.view.WindowManager
    
    84
    +
    
    83 85
     @Suppress("LargeClass", "TooManyFunctions")
    
    84 86
     class SettingsFragment : PreferenceFragmentCompat(), UserInteractionHandler {
    
    85 87
     
    
    ... ... @@ -577,6 +579,21 @@ class SettingsFragment : PreferenceFragmentCompat(), UserInteractionHandler {
    577 579
             val preferenceMakeDefaultBrowser =
    
    578 580
                 requirePreference<DefaultBrowserPreference>(R.string.pref_key_make_default_browser)
    
    579 581
     
    
    582
    +        // Copied from PrivateBrowsingFragment with some removals
    
    583
    +        requirePreference<SwitchPreference>(R.string.pref_key_allow_screenshots_in_private_mode).apply {
    
    584
    +            onPreferenceChangeListener = object : SharedPreferenceUpdater() {
    
    585
    +                override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
    
    586
    +                    if (newValue == false) {
    
    587
    +                        activity?.window?.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
    
    588
    +                    } else {
    
    589
    +                        activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
    
    590
    +                    }
    
    591
    +                    return super.onPreferenceChange(preference, newValue)
    
    592
    +                }
    
    593
    +            }
    
    594
    +        }
    
    595
    +
    
    596
    +
    
    580 597
             if (!Config.channel.isReleased) {
    
    581 598
                 preferenceLeakCanary?.setOnPreferenceChangeListener { _, newValue ->
    
    582 599
                     val isEnabled = newValue == true
    

  • mobile/android/fenix/app/src/main/res/xml/preferences.xml
    ... ... @@ -204,6 +204,11 @@
    204 204
             android:key="@string/pref_key_advanced"
    
    205 205
             android:layout="@layout/preference_category_no_icon_style">
    
    206 206
     
    
    207
    +        <SwitchPreference
    
    208
    +            android:key="@string/pref_key_allow_screenshots_in_private_mode"
    
    209
    +            app:iconSpaceReserved="false"
    
    210
    +            android:title="@string/preferences_allow_screenshots" />
    
    211
    +
    
    207 212
             <androidx.preference.Preference
    
    208 213
                 android:key="@string/pref_key_addons"
    
    209 214
                 app:iconSpaceReserved="false"
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx