diff options
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/foundation/e/advancedprivacy/features/location/FakeLocationFragment.kt | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/app/src/main/java/foundation/e/advancedprivacy/features/location/FakeLocationFragment.kt b/app/src/main/java/foundation/e/advancedprivacy/features/location/FakeLocationFragment.kt index 3aaeb61..6dafd5d 100644 --- a/app/src/main/java/foundation/e/advancedprivacy/features/location/FakeLocationFragment.kt +++ b/app/src/main/java/foundation/e/advancedprivacy/features/location/FakeLocationFragment.kt @@ -455,11 +455,9 @@ class FakeLocationFragment : NavToolbarFragment(R.layout.fragment_fake_location) if(!binding.edittextJitter.isFocused) binding.edittextJitter.setText(state.jitter?.toString()) - if (state.mode == LocationMode.REAL_LOCATION) { - binding.centeredMarker.isVisible = false - } else { + if (state.mode == LocationMode.SPECIFIC_LOCATION) { binding.mapLoader.isVisible = false - binding.mapOverlay.isVisible = state.mode != LocationMode.SPECIFIC_LOCATION + binding.mapOverlay.isVisible = false binding.centeredMarker.isVisible = true mapboxMap?.moveCamera( CameraUpdateFactory.newLatLng( @@ -469,6 +467,22 @@ class FakeLocationFragment : NavToolbarFragment(R.layout.fragment_fake_location) ) ) ) + } else if(state.mode == LocationMode.ROUTE) { + binding.mapLoader.isVisible = false + binding.mapOverlay.isVisible = true + binding.centeredMarker.isVisible = false + state.route?.let { + mapboxMap?.moveCamera( + CameraUpdateFactory.newLatLng( + LatLng( + state.route.first().latitude.toDouble(), + state.route.first().longitude.toDouble() + ) + ) + ) + } + } else { + binding.centeredMarker.isVisible = false } binding.textlayoutLatitude.isVisible = (state.mode == LocationMode.SPECIFIC_LOCATION) @@ -492,7 +506,7 @@ class FakeLocationFragment : NavToolbarFragment(R.layout.fragment_fake_location) locationComponent?.isLocationComponentEnabled = true locationComponent?.forceLocationUpdate(location) - if (mode == LocationMode.REAL_LOCATION) { + if (mode != LocationMode.SPECIFIC_LOCATION) { binding.mapLoader.isVisible = false binding.mapOverlay.isVisible = false @@ -508,7 +522,7 @@ class FakeLocationFragment : NavToolbarFragment(R.layout.fragment_fake_location) } } ?: run { locationComponent?.isLocationComponentEnabled = false - if (mode == LocationMode.REAL_LOCATION) { + if (mode != LocationMode.SPECIFIC_LOCATION) { binding.mapLoader.isVisible = true binding.mapOverlay.isVisible = true } |