Skip to content
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

Merged
merged 3 commits into from
Jun 14, 2022

Conversation

EternityForest
Copy link

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.

@EternityForest EternityForest changed the title Fix subdir list Enable listing contents of subfolders on the SAF Jun 13, 2022
@alexrintt
Copy link
Owner

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

@allcontributors
Copy link
Contributor

@lakscastro

I've put up a pull request to add @EternityForest! 🎉

@EternityForest
Copy link
Author

Awesome! Thanks for the wonderful library!

@alexrintt alexrintt merged commit 9eba51d into alexrintt:master Jun 14, 2022
Comment on lines +172 to +178
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));
}
Copy link
Owner

@alexrintt alexrintt Jun 14, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants