move location showing on map into Commons
This commit is contained in:
parent
17f77b67fb
commit
e37f42a93c
2 changed files with 2 additions and 12 deletions
|
@ -78,7 +78,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
||||||
|
|
|
@ -648,17 +648,7 @@ fun Activity.showFileOnMap(path: String) {
|
||||||
|
|
||||||
val latLon = FloatArray(2)
|
val latLon = FloatArray(2)
|
||||||
if (exif.getLatLong(latLon)) {
|
if (exif.getLatLong(latLon)) {
|
||||||
val uriBegin = "geo:${latLon[0]},${latLon[1]}"
|
showLocationOnMap("${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)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
toast(R.string.unknown_location)
|
toast(R.string.unknown_location)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue