From 15e40cdd3b4a9d45f3508195083d4e73b5deed1a Mon Sep 17 00:00:00 2001 From: jacquarg Date: Sun, 23 Jan 2022 19:59:02 +0100 Subject: Deactivate geolocation options while big btn is off --- .../features/location/FakeLocationFragment.kt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/src/main/java/foundation/e/privacycentralapp/features/location/FakeLocationFragment.kt b/app/src/main/java/foundation/e/privacycentralapp/features/location/FakeLocationFragment.kt index 60b9bd9..76c586c 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/features/location/FakeLocationFragment.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/features/location/FakeLocationFragment.kt @@ -222,10 +222,20 @@ class FakeLocationFragment : @SuppressLint("MissingPermission") override fun render(state: FakeLocationFeature.State) { - binding.radioUseRandomLocation.isChecked = (state.mode == LocationMode.RANDOM_LOCATION) - binding.radioUseSpecificLocation.isChecked = - (state.mode == LocationMode.SPECIFIC_LOCATION) - binding.radioUseRealLocation.isChecked = (state.mode == LocationMode.REAL_LOCATION) + binding.radioUseRandomLocation.apply { + isChecked = state.mode == LocationMode.RANDOM_LOCATION + isEnabled = state.isEnabled + } + + binding.radioUseSpecificLocation.apply { + isChecked = state.mode == LocationMode.SPECIFIC_LOCATION + isEnabled = state.isEnabled + } + + binding.radioUseRealLocation.apply { + isChecked = state.mode == LocationMode.REAL_LOCATION + isEnabled = state.isEnabled + } binding.mapView.isEnabled = (state.mode == LocationMode.SPECIFIC_LOCATION) -- cgit v1.2.1