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:

- 
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
- mobile/android/fenix/app/src/main/res/xml/preferences.xml


Changes:

=====================================
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
=====================================
@@ -80,6 +80,8 @@ import org.mozilla.fenix.utils.Settings
 import kotlin.system.exitProcess
 import org.mozilla.fenix.GleanMetrics.Settings as SettingsMetrics
 
+import android.view.WindowManager
+
 @Suppress("LargeClass", "TooManyFunctions")
 class SettingsFragment : PreferenceFragmentCompat(), UserInteractionHandler {
 
@@ -577,6 +579,21 @@ class SettingsFragment : PreferenceFragmentCompat(), 
UserInteractionHandler {
         val preferenceMakeDefaultBrowser =
             
requirePreference<DefaultBrowserPreference>(R.string.pref_key_make_default_browser)
 
+        // Copied from PrivateBrowsingFragment with some removals
+        
requirePreference<SwitchPreference>(R.string.pref_key_allow_screenshots_in_private_mode).apply
 {
+            onPreferenceChangeListener = object : SharedPreferenceUpdater() {
+                override fun onPreferenceChange(preference: Preference, 
newValue: Any?): Boolean {
+                    if (newValue == false) {
+                        
activity?.window?.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
+                    } else {
+                        
activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
+                    }
+                    return super.onPreferenceChange(preference, newValue)
+                }
+            }
+        }
+
+
         if (!Config.channel.isReleased) {
             preferenceLeakCanary?.setOnPreferenceChangeListener { _, newValue 
->
                 val isEnabled = newValue == true


=====================================
mobile/android/fenix/app/src/main/res/xml/preferences.xml
=====================================
@@ -204,6 +204,11 @@
         android:key="@string/pref_key_advanced"
         android:layout="@layout/preference_category_no_icon_style">
 
+        <SwitchPreference
+            android:key="@string/pref_key_allow_screenshots_in_private_mode"
+            app:iconSpaceReserved="false"
+            android:title="@string/preferences_allow_screenshots" />
+
         <androidx.preference.Preference
             android:key="@string/pref_key_addons"
             app:iconSpaceReserved="false"



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/f48e08833568334442fad849d65bbfbc6e391225

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/f48e08833568334442fad849d65bbfbc6e391225
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tbb-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to