couple edits to URI obtaining at Edit activity
This commit is contained in:
parent
cb3b3b65d6
commit
6eeece124a
1 changed files with 13 additions and 8 deletions
|
@ -63,15 +63,20 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
saveUri = when {
|
if (intent.extras?.containsKey(REAL_FILE_PATH) == true) {
|
||||||
intent.extras?.containsKey(REAL_FILE_PATH) == true -> {
|
val realPath = intent.extras.getString(REAL_FILE_PATH)
|
||||||
val realPath = intent.extras.getString(REAL_FILE_PATH)
|
uri = when {
|
||||||
if (realPath.startsWith(OTG_PATH)) {
|
realPath.startsWith(OTG_PATH) -> Uri.parse(realPath)
|
||||||
Uri.parse(realPath)
|
realPath.startsWith("file:/") -> Uri.parse(realPath)
|
||||||
} else {
|
else -> Uri.fromFile(File(realPath))
|
||||||
Uri.fromFile(File(realPath))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
(getRealPathFromURI(uri))?.apply {
|
||||||
|
uri = Uri.fromFile(File(this))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
saveUri = when {
|
||||||
intent.extras?.containsKey(MediaStore.EXTRA_OUTPUT) == true -> intent.extras!!.get(MediaStore.EXTRA_OUTPUT) as Uri
|
intent.extras?.containsKey(MediaStore.EXTRA_OUTPUT) == true -> intent.extras!!.get(MediaStore.EXTRA_OUTPUT) as Uri
|
||||||
else -> uri
|
else -> uri
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue