-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix the bug(issue: #944) blank screen issue with viewpager2 #956
base: master
Are you sure you want to change the base?
Conversation
Can this update be released? or can you provide code where to edit? i have this issue so i need to fix it on local repo. |
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.
I have tried this commit in my project in which i get pdf files from server and it is working with no longer blanks showing when returning to previous tab from next tab.
Owing to this bug DImuthuUpe/AndroidPdfViewer#956, we cannot continue with this solution yet.
Owing to this bug DImuthuUpe/AndroidPdfViewer#956, we cannot continue with this solution yet. Although I copied the fix and made further adjustment to stop a crash, I found that pinch zooming on music sheet doesn't work properly. It seems that viewPager2 kind of intercepts all touches. Found a similar complaint here https://stackoverflow.com/questions/64815798/how-to-expand-the-view-while-zooming-an-image-into-viewpager2 Would test this later
Good Morning, i'm facing the issue here exposed: i'm using version 2.8.2 and i don't find the option autoReleasingWhenDetachedFromWindow mentioned above. I've also tried to implement latest beta version but it seems the option is not present in this version also. Can you please tell me if any solution has been found to this problem? Thank you for your work |
@Flaviosar78 This issue was fixed in this fork https://github.com/TalbotGooday/AndroidPdfViewer |
Just another question: i'm
Thank you sir, I've implemented your fork and i'm having same behaviour: There is any option to set to avoid blank screen? |
@Flaviosar78 sorry, I fixed this particular issue on the app side instead of inside the library. I wrapped the PDFView inside my own custom view , and in |
If PDFView is used in ViewPager,it may show blank page, this issue is caused by the follow code:
@Override protected void onDetachedFromWindow() { recycle(); if (renderingHandlerThread != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { renderingHandlerThread.quitSafely(); } else { renderingHandlerThread.quit(); } renderingHandlerThread = null; } super.onDetachedFromWindow(); }
I have added an option autoReleasingWhenDetachedFromWindow that developer can make a decision whether PDFView would recycle automatically when it is detached from window.
If PDFView is used in ViewPager, we can set autoReleasingWhenDetachedFromWindow = false and call PDFView#release() when fragment or parent view is destroyed to avoid this issue.