mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
move config logic from location manager to keep it lazy
This commit is contained in:
@ -358,7 +358,23 @@ class CameraXPreview(
|
||||
if (simpleLocationManager == null) {
|
||||
simpleLocationManager = SimpleLocationManager(activity)
|
||||
}
|
||||
simpleLocationManager?.requestLocationUpdates()
|
||||
requestLocationUpdates()
|
||||
}
|
||||
}
|
||||
|
||||
private fun requestLocationUpdates() {
|
||||
activity.apply {
|
||||
if (checkLocationPermission()) {
|
||||
simpleLocationManager?.requestLocationUpdates()
|
||||
} else {
|
||||
handlePermission(PERMISSION_ACCESS_FINE_LOCATION) { _ ->
|
||||
if (checkLocationPermission()) {
|
||||
simpleLocationManager?.requestLocationUpdates()
|
||||
} else {
|
||||
config.savePhotoVideoLocation = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user