10000 feat(android):add content uri support for File by triniwiz · Pull Request #9807 · NativeScript/NativeScript · GitHub
[go: up one dir, main page]

Skip to content

feat(android):add content uri support for File #9807

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

Merged
merged 2 commits into from
Mar 5, 2022

Conversation

triniwiz
Copy link
Member
@triniwiz triniwiz commented Mar 4, 2022

Allows the File class to handle content:// uris on android

@cla-bot cla-bot bot added the cla: yes label Mar 4, 2022
@farfromrefug
Copy link
Collaborator

@triniwiz i feel like the Android File implementation is a bit dirty being done the way it is . Why not in file-system-access.android.ts ? It would be much cleaner and prevent the need for the global.isAndroid

Also is your code working with a file picked through Intent.ACTION_OPEN_DOCUMENT_TREE or Intent.ACTION_OPEN_DOCUMENT ? Seems weird that it would work without using DocumentContract.

Also it is a bit sad that your rewrite a way to read text in FileHelper and not use the same way in https://github.com/NativeScript/NativeScript/blob/master/packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/Async.java
My implementation here #9661 had the benefit of refactoring code and not have duplicated functions.
May i ask you decided not to build on top? It even had a native test app to run automatic test on the native impl

@triniwiz
Copy link
Member Author
triniwiz commented Mar 5, 2022

@farfromrefug this is a temp what I'm really working on is much larger that this , also I just noticed that read from the async method an it's a bit cleaner now

@triniwiz
Copy link
Member Author
triniwiz commented Mar 5, 2022

I don't see why it won't work with files picked with those , I believe the content resolver should be fine with those.

@NathanWalker NathanWalker merged commit c68d002 into release/8.2.0 Mar 5, 2022
@NathanWalker NathanWalker deleted the feat/android-file-helper branch March 5, 2022 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0