From 942d4d310f8d76e8479d32bd6aeec9341e8f0dda Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Mon, 11 Jul 2022 15:59:08 +0200 Subject: [PATCH 1/2] Make openBrowserAt() private --- .../src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt index 0b5fd2b8b..4f2e7c5ee 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt @@ -64,7 +64,7 @@ class SettingsFragment : ResourceSettingsFragment() { } } - fun openBrowserAt(url: String) { + private fun openBrowserAt(url: String) { val intent = Intent(Intent.ACTION_VIEW) intent.data = Uri.parse(url) startActivity(intent) -- GitLab From 0808fb961efa0e19e8bcbd90c96a7fbf88240ab5 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Mon, 11 Jul 2022 16:00:36 +0200 Subject: [PATCH 2/2] Do not show Install EN preference in EN version of GmsCore --- .../org/microg/gms/ui/SettingsFragment.kt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt index 4f2e7c5ee..e37a99412 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt @@ -20,6 +20,8 @@ import org.microg.nlp.client.LocationClient import org.microg.tools.ui.ResourceSettingsFragment import android.content.Intent import android.net.Uri +import com.google.android.gms.BuildConfig +import java.util.Locale class SettingsFragment : ResourceSettingsFragment() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { @@ -45,10 +47,19 @@ class SettingsFragment : ResourceSettingsFragment() { findNavController().navigate(requireContext(), NearbyPreferencesIntegration.exposureNotificationNavigationId) true } - findPreference(PREF_EXPOSURE_INSTALL)?.onPreferenceClickListener = Preference.OnPreferenceClickListener { - openBrowserAt(EXPOSURE_INSTALL_DOC_URL) - true + + findPreference(PREF_EXPOSURE_INSTALL)?.apply { + onPreferenceClickListener = Preference.OnPreferenceClickListener { + openBrowserAt(EXPOSURE_INSTALL_DOC_URL) + true + } + + if (BuildConfig.FLAVOR.lowercase(Locale.ROOT).contains("withnearby")) { + isVisible = false + } } + + findPreference(PREF_ABOUT)!!.onPreferenceClickListener = Preference.OnPreferenceClickListener { findNavController().navigate(requireContext(), R.id.openAbout) true -- GitLab