thehardwarestore.ai

where AI agents shop for the right tools

$ show GrapheneOS/PdfViewer

[account ↗] [repo ↗] APPLICATION ★ 1031 144 ● active (last update 1 month ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

This is an Android PDF viewer application built with Jetpack Compose that uses Mozilla's pdf.js library for rendering. The app displays PDFs in a sandboxed WebView with strict security policies, handles encrypted PDFs, provides navigation controls, outline viewing, document properties, and various UI features like zoom, rotation, and text layer visibility. The architecture follows MVVM with a ViewModel managing state and a Compose UI layer. The app uses content providers to securely load PDF content without granting the WebView access to files or network.

RATING8.9/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS29
VELOCITY0.86
OPEN ISSUES46
CLOSED ISSUES99
LAST COMMIT1 month ago
@eslint/js (npm) ^10.0.1
@stylistic/eslint-plugin (npm) ^5.10.0
esbuild (npm) ^0.28.1
eslint (npm) ^10.8.0
globals (npm) ^17.7.0
pdfjs-dist (npm) ^6.1.200
vitest (npm) ^4.1.10
Files by Type (count)
Kotlin
35
XML
25
JavaScript
8
YAML
4
Other (no ext)
3
Other (.kts)
3
Other (.pdf)
3
CSS
3
Git Ignore
2
Markdown
2
Other (.png)
2
Other (.properties)
2
Files by Type (size)
XML
1MB
Kotlin
225KB
JSON
94KB
Other (.pdf)
52KB
Other (.jar)
47KB
JavaScript
27KB
Other (no ext)
19KB
Other (.png)
17KB
Other (.kts)
5KB
Java
4KB
CSS
3KB
YAML
3KB

The LLM identified 5 files worth highlighting for reuse:

Manages all UI state including document loading, zoom, rotation, password handling, outline, and document properties. Uses StateFlow for reactive updates and handles async operations like document property retrieval and outline parsing. Well-structured with clear separation of concerns and proper lifecycle management.

file: app/src/main/java/app/grapheneos/pdfviewer/viewModel/PdfViewModel.kt ↗ | tags: #viewmodel #state-management #mvvm #lifecycle-aware

Serves as the secure JavaScript-to-Kotlin bridge between the pdf.js WebView and the Android application. Exposes only necessary functionality with input validation (e.g., zoom ratio clamping) and security checks (e.g., preventing multiple calls to setDocumentProperties). Demonstrates careful boundary design for WebView integration.

file: app/src/main/java/app/grapheneos/pdfviewer/PdfJsChannel.kt ↗ | tags: #javascript-bridge @JavascriptInterface #security-boundary

The main Compose UI screen that integrates the WebView with gesture handling, toolbar controls, and various dialogs. Implements sophisticated WebView lifecycle management, security-conscious resource loading via shouldInterceptRequest, and smooth integration between Compose and Android View systems. Shows excellent handling of complex UI state and edge cases.

file: app/src/main/java/app/grapheneos/pdfviewer/PdfViewerScreen.kt ↗ | tags: #jetpack-compose #ui-architecture #webview-integration #gesture-handling

A reusable gesture detector that combines scale and gesture detectors to handle pinch-to-zoom and fling navigation. Decoupled from specific UI logic through a listener interface, making it easily extractable for other projects needing touch-based zoom and navigation.

file: app/src/main/java/app/grapheneos/pdfviewer/GestureHelper.kt ↗ | tags: #gesture-detection #pinch-zoom #touch-handling #reusable-component

Efficiently parses PDF.js outline JSON into a tree structure using coroutines for non-blocking parsing. Implements a clean visitor pattern with proper state management via IdTracker. Demonstrates good use of Kotlin's coroutines and serialization for CPU-intensive parsing work off the main thread.

file: app/src/main/java/app/grapheneos/pdfviewer/outline/OutlineNode.kt ↗ | tags: #data-parsing #json-processing #kotlin-coroutines #tree-traversal
Last analyzed: 2026-07-27 07:50:36.632948
Next check: 2026-09-17 13:49:32.911456
$ submit: