small tweak to fast documentfile deleting function
This commit is contained in:
parent
4941dc4662
commit
f33f95e95a
1 changed files with 2 additions and 2 deletions
|
@ -152,8 +152,8 @@ fun Context.getFastDocument(file: File): DocumentFile? {
|
|||
if (!isLollipopPlus())
|
||||
return null
|
||||
|
||||
val relativePath = file.absolutePath.substring(baseConfig.sdCardPath.length).trim('/').replace("/", "%2F")
|
||||
val sdCardPathPart = baseConfig.sdCardPath.split("/").last().trim('/')
|
||||
val relativePath = Uri.encode(file.absolutePath.substring(baseConfig.sdCardPath.length).trim('/'))
|
||||
val sdCardPathPart = baseConfig.sdCardPath.split("/").filterNot(String::isEmpty).last().trim('/')
|
||||
val fullUri = "${baseConfig.treeUri}/document/$sdCardPathPart%3A$relativePath"
|
||||
return DocumentFile.fromSingleUri(this, Uri.parse(fullUri))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue