Dan Ballard pushed to branch firefox-android-115.2.1-13.0-1 at The Tor Project / Applications / firefox-android
Commits:
-
2ed6053c
by Dan Ballard at 2023-09-12T09:06:04-07:00
5 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
- fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
- fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
- fenix/app/src/main/res/navigation/nav_graph.xml
- fenix/app/src/main/res/xml/preferences.xml
Changes:
... | ... | @@ -848,7 +848,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider { |
848 | 848 | clipboardSuggestionsEnabled.set(settings.shouldShowClipboardSuggestions)
|
849 | 849 | searchShortcutsEnabled.set(settings.shouldShowSearchShortcuts)
|
850 | 850 | voiceSearchEnabled.set(settings.shouldShowVoiceSearch)
|
851 | - openLinksInAppEnabled.set(settings.openLinksInExternalApp)
|
|
851 | + //openLinksInAppEnabled.set(settings.openLinksInExternalApp)
|
|
852 | 852 | signedInSync.set(settings.signedInFxaAccount)
|
853 | 853 | |
854 | 854 | val syncedItems = SyncEnginesStorage(applicationContext).getStatus().entries.filter {
|
... | ... | @@ -234,9 +234,11 @@ class SettingsFragment : PreferenceFragmentCompat() { |
234 | 234 | getString(R.string.preferences_credit_cards)
|
235 | 235 | }
|
236 | 236 | |
237 | + /*
|
|
237 | 238 | val openLinksInAppsSettingsPreference =
|
238 | 239 | requirePreference<Preference>(R.string.pref_key_open_links_in_apps)
|
239 | 240 | openLinksInAppsSettingsPreference.summary = context?.settings()?.getOpenLinksInAppsString()
|
241 | + */
|
|
240 | 242 | |
241 | 243 | // Hide "Delete browsing data on quit" when in Private Browsing-only mode
|
242 | 244 | deleteBrowsingDataPreference.isVisible =
|
... | ... | @@ -308,9 +310,11 @@ class SettingsFragment : PreferenceFragmentCompat() { |
308 | 310 | Addons.openAddonsInSettings.record(mozilla.components.service.glean.private.NoExtras())
|
309 | 311 | SettingsFragmentDirections.actionSettingsFragmentToAddonsFragment()
|
310 | 312 | }
|
313 | + /*
|
|
311 | 314 | resources.getString(R.string.pref_key_open_links_in_apps) -> {
|
312 | 315 | SettingsFragmentDirections.actionSettingsFragmentToOpenLinksInAppsFragment()
|
313 | 316 | }
|
317 | + */
|
|
314 | 318 | resources.getString(R.string.pref_key_data_choices) -> {
|
315 | 319 | SettingsFragmentDirections.actionSettingsFragmentToDataChoicesFragment()
|
316 | 320 | }
|
... | ... | @@ -599,6 +599,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
599 | 599 | /**
|
600 | 600 | * Get the display string for the current open links in apps setting
|
601 | 601 | */
|
602 | + /*
|
|
602 | 603 | fun getOpenLinksInAppsString(): String =
|
603 | 604 | when (openLinksInExternalApp) {
|
604 | 605 | appContext.getString(R.string.pref_key_open_links_in_apps_always) -> {
|
... | ... | @@ -615,6 +616,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
615 | 616 | appContext.getString(R.string.preferences_open_links_in_apps_never)
|
616 | 617 | }
|
617 | 618 | }
|
619 | + */
|
|
618 | 620 | |
619 | 621 | var shouldUseDarkTheme by booleanPreference(
|
620 | 622 | appContext.getPreferenceKey(R.string.pref_key_dark_theme),
|
... | ... | @@ -1298,26 +1300,31 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
1298 | 1300 | /**
|
1299 | 1301 | * Check to see if we should open the link in an external app
|
1300 | 1302 | */
|
1303 | + @Suppress("UNUSED_PARAMETER")
|
|
1301 | 1304 | fun shouldOpenLinksInApp(isCustomTab: Boolean = false): Boolean {
|
1302 | - return when (openLinksInExternalApp) {
|
|
1303 | - appContext.getString(R.string.pref_key_open_links_in_apps_always) -> true
|
|
1304 | - appContext.getString(R.string.pref_key_open_links_in_apps_ask) -> true
|
|
1305 | + return false
|
|
1306 | + //return when (openLinksInExternalApp) {
|
|
1307 | + // appContext.getString(R.string.pref_key_open_links_in_apps_always) -> true
|
|
1308 | + // appContext.getString(R.string.pref_key_open_links_in_apps_ask) -> true
|
|
1305 | 1309 | /* Some applications will not work if custom tab never open links in apps, return true if it's custom tab */
|
1306 | - appContext.getString(R.string.pref_key_open_links_in_apps_never) -> isCustomTab
|
|
1307 | - else -> false
|
|
1308 | - }
|
|
1310 | + // appContext.getString(R.string.pref_key_open_links_in_apps_never) -> isCustomTab
|
|
1311 | + //else -> false
|
|
1312 | + //}
|
|
1309 | 1313 | }
|
1310 | 1314 | |
1311 | 1315 | /**
|
1312 | 1316 | * Check to see if we need to prompt the user if the link can be opened in an external app
|
1313 | 1317 | */
|
1314 | 1318 | fun shouldPromptOpenLinksInApp(): Boolean {
|
1319 | + return true
|
|
1320 | + /*
|
|
1315 | 1321 | return when (openLinksInExternalApp) {
|
1316 | 1322 | appContext.getString(R.string.pref_key_open_links_in_apps_always) -> false
|
1317 | 1323 | appContext.getString(R.string.pref_key_open_links_in_apps_ask) -> true
|
1318 | 1324 | appContext.getString(R.string.pref_key_open_links_in_apps_never) -> true
|
1319 | 1325 | else -> true
|
1320 | 1326 | }
|
1327 | + */
|
|
1321 | 1328 | }
|
1322 | 1329 | |
1323 | 1330 | var openLinksInExternalApp by stringPreference(
|
... | ... | @@ -723,6 +723,7 @@ |
723 | 723 | app:exitAnim="@anim/slide_out_left"
|
724 | 724 | app:popEnterAnim="@anim/slide_in_left"
|
725 | 725 | app:popExitAnim="@anim/slide_out_right" />
|
726 | + <!--
|
|
726 | 727 | <action
|
727 | 728 | android:id="@+id/action_settingsFragment_to_openLinksInAppsFragment"
|
728 | 729 | app:destination="@id/openLinksInAppsFragment"
|
... | ... | @@ -730,6 +731,7 @@ |
730 | 731 | app:exitAnim="@anim/slide_out_left"
|
731 | 732 | app:popEnterAnim="@anim/slide_in_left"
|
732 | 733 | app:popExitAnim="@anim/slide_out_right" />
|
734 | + -->
|
|
733 | 735 | <action
|
734 | 736 | android:id="@+id/action_settingsFragment_to_tabsSettingsFragment"
|
735 | 737 | app:destination="@id/tabsSettingsFragment"
|
... | ... | @@ -963,9 +965,11 @@ |
963 | 965 | app:popEnterAnim="@anim/slide_in_left"
|
964 | 966 | app:popExitAnim="@anim/slide_out_right" />
|
965 | 967 | </fragment>
|
968 | + <!--
|
|
966 | 969 | <fragment
|
967 | 970 | android:id="@+id/openLinksInAppsFragment"
|
968 | 971 | android:name="org.mozilla.fenix.settings.OpenLinksInAppsFragment" />
|
972 | + -->
|
|
969 | 973 | <fragment
|
970 | 974 | android:id="@+id/deleteBrowsingDataFragment"
|
971 | 975 | android:name="org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataFragment"
|
... | ... | @@ -180,12 +180,12 @@ |
180 | 180 | android:key="@string/pref_key_override_amo_collection"
|
181 | 181 | app:iconSpaceReserved="false"
|
182 | 182 | android:title="@string/preferences_customize_amo_collection" />
|
183 | - |
|
183 | + <!--
|
|
184 | 184 | <androidx.preference.Preference
|
185 | 185 | android:key="@string/pref_key_open_links_in_apps"
|
186 | 186 | android:title="@string/preferences_open_links_in_apps"
|
187 | 187 | app:iconSpaceReserved="false" />
|
188 | - |
|
188 | + -->
|
|
189 | 189 | <androidx.preference.SwitchPreference
|
190 | 190 | android:defaultValue="false"
|
191 | 191 | android:key="@string/pref_key_external_download_manager"
|