Rendering on Android blocks UI
Describe the bug
Using PdfPage.render on Android blocks the UI.
To Reproduce Steps to reproduce the behavior:
- Add a
PdfViewto your UI - add a custom
renderer(the bigger the image, the better you'll see the behavior)
Expected behavior Smooth working UI/ UI not being blocked
Screenshots
iOS (Good)
Android(Bad)
Smartphone (please complete the following information):
- Device: POCO X3 PRO
- OS: Android
- Version: 11
Additional context Add any other context about the problem here.
My Kotlin is awefull so I asked ChatGPT to "Fix the code in a way it wouldn't block the UI" and it added coroutines. Not it's no longer blocking the UI.
I've only done this for the render and openDocumentFile just to test so it might need to be added to others as well?
@SEGVeenstra could you share the code for your fix and/or open a pull request with the changes?
@SEGVeenstra could you share the code for your fix and/or open a pull request with the changes?
Like I mentioned, I'm not into Kotlin, but this has the changes I got from ChatGPT: