📝 Describe the Bug
When using a viewpager content is lost when coming back to a PDF view.
Reason:
You are releasing resurces in PdfRendererView.onDetachedFromWindow() but you are not re-aquiring the resurces in the corresponding onAttachedFromWindow(), and therefore your component doesent work inside a viewpager.
Read more here:
https://stackoverflow.com/questions/42126105/android-view-onattachedtowindow-and-ondetachedfromwindow-when-are-they-calle
📖 Library Version
- PDF Viewer Version: v2.3.7.
The bug is not present in v2.3.6 - see v2.3.6...v2.3.7
Specifically, I think it happens because you clear the adapter here:
🖼️ Screenshots/Videos
Using implementation("io.github.afreakyelf:Pdf-Viewer:2.3.7"), first display reveals the PDF
navigating to other tab and back again the PDF content is lost:
🖼️ Screenshots/Videos of the same code using v2.3.6
navigating to other tab and back again the PDF content is intact:
