mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-31 12:11:15 -04:00
change provideLocation on isPressed
This commit is contained in:
@@ -380,12 +380,12 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
binding.provideLocationCheckbox.setOnCheckedChangeListener { view, isChecked ->
|
||||
model.provideLocation.value = isChecked
|
||||
// Don't check the box until the system setting changes
|
||||
view.isChecked = isChecked && myActivity.hasBackgroundPermission()
|
||||
|
||||
if (view.isPressed) { // We want to ignore changes caused by code (as opposed to the user)
|
||||
debug("User changed location tracking to $isChecked")
|
||||
model.provideLocation.value = isChecked
|
||||
if (isChecked && !view.isChecked)
|
||||
MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.background_required)
|
||||
|
||||
Reference in New Issue
Block a user