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] Freezing UI, when trying to load PDF from a file (Jetpack Compose). #171

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

Comments

@raudonikis
Copy link

raudonikis commented Nov 29, 2024

📝 Describe the Bug

Freezing UI (for up to ~2 seconds), when trying to load PDF from a file (Jetpack Compose).

📖 Library Version

  • PDF Viewer Version:: 2.1.1

🚶 Steps to Reproduce

Please follow these steps to reproduce the issue:

  1. Initial Setup/Library Method Used: PdfRendererViewCompose(file = file)
  2. Actions Taken: Trying to display the PDF from a file, in a composable.
  3. Unexpected Behavior: Freezing UI for up to 2 seconds.
  4. Relevant Code/Stack Trace:
@Composable
fun SomeScreen() {
    PdfRendererViewCompose(
            file = file,
            modifier = Modifier.weight(1f),
            statusCallBack = pdfStatusCallback,
    )
    <...>
}

🤔 Expected Behavior

UI not freezing :)

📱 Smartphone Info:

  • Device: [e.g., Samsung Galaxy A23, Pixel 8 Pro emulator]
  • OS: [e.g., Android 14, Android 11]
  • Library Version: [e.g., 2.1.1]

💻 Code Snippets

  • Nothing fancy, added code snippets above

📜 Log Output/Stack Trace

StrictMode is reporting disk read violations:

StrictMode policy violation; ~duration=756 ms: android.os.strictmode.DiskReadViolation
<...>
at android.graphics.pdf.PdfRenderer.<init>(PdfRenderer.java:165)
<...>
at com.rajat.pdfviewer.compose.PdfRendererComposeKt$PdfRendererViewCompose$1.invoke(PdfRendererCompose.kt:33)
<...>
@raudonikis raudonikis added the bug Something isn't working label Nov 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