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 0b5fd2b8bbcbd8afb4e8413ffd3a0a86efb31485..e37a99412f340e5a7b586edcb99a5e8cc008a06e 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 @@ -64,7 +75,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)