Skip to content

Commit

Permalink
Fix file name in uri
Browse files Browse the repository at this point in the history
  • Loading branch information
ismartcoding committed Sep 5, 2023
1 parent d7f3ea8 commit a36e4e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ android {
else -> 0
}

val vCode = 119
val vCode = 122
versionCode = vCode - singleAbiNum
versionName = "1.1.19"
versionName = "1.1.20"

ndk {
if (abiFilterList.isNotEmpty()) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/main/java/com/ismartcoding/lib/extensions/Uri.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import android.provider.OpenableColumns

fun Uri.getFileName(context: Context): String {
if (scheme == ContentResolver.SCHEME_FILE) {
return this.toString().getFilenameFromPath()
return this.lastPathSegment ?: ""
}

var fileName = ""
Expand All @@ -23,7 +23,7 @@ fun Uri.getFileName(context: Context): String {

if (fileName.isEmpty()) {
// Fallback: Extract file name from the URI
fileName = this.toString().getFilenameFromPath()
fileName = this.lastPathSegment ?: ""
}

return fileName
Expand Down

0 comments on commit a36e4e1

Please sign in to comment.