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

Feature/support android file choose #211

Merged

Conversation

briandr97
Copy link
Contributor

Hi @KevinnZou thank you for creating this library. I'm using this in Compose Multiplatform and have encountered a problem.
In my service, I need to get some images from device. And on Android, the file chooser isn't opened in the WebView unless we implement onShowFileChooser. So I added code to override onShowFileChooser in the WebChromeClient. I'm on a deadline, so I was wondering if you could please reflect this change?

Key Changes:

  • override WebChromeClient's onShowFileChooser on Android side.
  • add sample for choose files

Result:

@KevinnZou
Copy link
Owner

@briandr97 Thanks for your contribution! You did a great job! However, we may not be able to merge this PR. The reason is that you have directly created a FileChoosableWebChromeClient and implemented file selection capabilities within this PR. However, for other developers, they might prefer to implement file selection in a different style. If we lock down a specific implementation, it will make the library less flexible, which is why we have not provided support for custom capabilities like this. We encourage developers to fork our library and add custom features. Of course, there is a solution to this problem, which is to allow developers to provide custom AccompanistWebViewClient and AccompanistWebChromeClient. In that case, you can achieve this requirement by providing your own FileChoosableWebChromeClient. If you are interested, you can try modifying your PR to this solution. Thank you again.

@KevinnZou KevinnZou merged commit 3f6abe0 into KevinnZou:main Nov 5, 2024
4 checks passed
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