move location showing on map into Commons

This commit is contained in:
tibbi 2020-04-18 11:38:19 +02:00
parent 17f77b67fb
commit e37f42a93c
2 changed files with 2 additions and 12 deletions

View file

@ -78,7 +78,7 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.25.24'
implementation 'com.simplemobiletools:commons:5.25.25'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -648,17 +648,7 @@ fun Activity.showFileOnMap(path: String) {
val latLon = FloatArray(2)
if (exif.getLatLong(latLon)) {
val uriBegin = "geo:${latLon[0]},${latLon[1]}"
val query = "${latLon[0]}, ${latLon[1]}"
val encodedQuery = Uri.encode(query)
val uriString = "$uriBegin?q=$encodedQuery&z=16"
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(uriString))
val packageManager = packageManager
if (intent.resolveActivity(packageManager) != null) {
startActivity(intent)
} else {
toast(R.string.no_app_found)
}
showLocationOnMap("${latLon[0]}, ${latLon[1]}")
} else {
toast(R.string.unknown_location)
}