-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable listing contents of subfolders on the SAF #59
Conversation
Thanks for the PR! I'll take a look at the related issue, this PR and and merge this. @all-contributors add EternityForest for code, docs |
@lakscastro I've put up a pull request to add @EternityForest! 🎉 |
Awesome! Thanks for the wonderful library! |
try { | ||
// for childs and sub child dirs | ||
childrenUritmp = DocumentsContract.buildChildDocumentsUriUsingTree(rootUri, DocumentsContract.getDocumentId(rootUri)); | ||
} catch (e: Exception) { | ||
// for parent dir | ||
childrenUritmp = DocumentsContract.buildChildDocumentsUriUsingTree(rootUri, DocumentsContract.getTreeDocumentId(rootUri)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes a lot of sense. I knew something was missing in this function since the subfolders wasn't allowed to be listed even if we had permisions over a parent folder.
Most of times testing and debugging this kind of operation is not trivial and requires a lot of time, thanks for the efforts! I'll make sure to publish into the next release and since it's not a breaking change and fixes a current behavior probably will be done on v0.3.2.
Closes issue #58.
Previously, calling listFiles on any document would always list the contents of the user-selected root in which the document resides. Now it will correctly list the children of subfolders.
Please review before merging, if you do decide that this is interesting, as I have never done anything with Kotlin until today.