Skip to content

Commit

Permalink
get Recents file name from its path, if not filled in
Browse files Browse the repository at this point in the history
  • Loading branch information
tibbi committed May 20, 2021
1 parent 9f15dc3 commit a48300e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage

context?.queryCursor(uri, projection, sortOrder = sortOrder, showErrors = true) { cursor ->
val path = cursor.getStringValue(FileColumns.DATA)
val name = cursor.getStringValue(FileColumns.DISPLAY_NAME)
val name = cursor.getStringValue(FileColumns.DISPLAY_NAME) ?: path.getFilenameFromPath()
val size = cursor.getLongValue(FileColumns.SIZE)
val modified = cursor.getLongValue(FileColumns.DATE_MODIFIED) * 1000
val fileDirItem = ListItem(path, name, false, 0, size, modified, false)
Expand Down

0 comments on commit a48300e

Please sign in to comment.