mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
change provideLocation on isPressed
This commit is contained in:
parent
689e7e7eca
commit
3d79601965
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue