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

[BUG] PinchZoomRecyclerView.canScrollVertically(1) always return false #153

Open
handhand opened this issue Aug 29, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@handhand
Copy link

📝 Describe the Bug

We uses pdfView.recyclerView.canScrollVertically(1) to detect whether the pdf is scrolled to the very bottom(not the last page), to ensure user has read the whole content.
But since 2.1.0, PinchZoomRecyclerView.canScrollVertically(1) always return false

📖 Library Version

  • PDF Viewer Version: [e.g., 2.1.0]

🚶 Steps to Reproduce

Please follow these steps to reproduce the issue:

  1. Initial Setup/Library Method Used: [e.g., initWithUrl method]
    In PdfViewerActivity, add the below snippet:
    binding.pdfView.recyclerView.addOnScrollListener(object: RecyclerView.OnScrollListener() {
    override fun onScrolled(recyclerView: RecyclerView, dx:Int, dy:Int) {
    super.onScrolled(recyclerView(recyclerView, dx, dy)
    Log.d("pdfViewer", binding.pdfView.recyclerView.canScrollVertically(1).toString())
    }
    }
    )
    Run and scroll the pdf, and observe the log.

  2. Actions Taken: [e.g., Clicked on 'Load PDF']

  3. Unexpected Behavior: [e.g., PDF not loading]

  4. Relevant Code/Stack Trace: [Include code snippet or stack trace if applicable]
    We found that in PinchZoomRecyclerView, if scale is 1, then mPoxY is always 0, then the override computeVerticalScrollOffset() always return 0, which breaks canScrollVertically() eventually.

🤔 Expected Behavior

What did you expect to happen?
canScrollVertically() returns false only when the pdf reaches the bottom

🖼️ Screenshots/Videos

If applicable, add screenshots or videos to help explain your problem.

📱 Smartphone Info:

  • Device: [e.g., Samsung Galaxy S10]
  • OS: [e.g., Android 11]
  • Library Version: [e.g., 2.0.0]

💻 Code Snippets

Include relevant code snippets or links to code repositories.

📜 Log Output/Stack Trace

Include any error logs or stack trace for more context.

💬 Additional Context

Add any other context about the problem here. Mention if the issue is consistent, specific scenarios where the bug occurs, etc.


@handhand handhand added the bug Something isn't working label Aug 29, 2024
Copy link

Thank you for creating your first issue. We appreciate your help in making this project better. We will look into it, and get back to you soon. Need help or want to discuss this issue? Join our Discord community here to ask questions and discuss this issue live!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant