How binishmatheww/scanner works
Main Components
a. User Interface Layer:
• Compose UI Components (under views/composables)
• Traditional XML Layouts (under res/layout)
• Fragments for different screens
• Activity as the main container (LauncherActivity)
b. Business Logic Layer:
• ViewModels (CameraViewModel, HomeViewModel, PdfEditorViewModel)
• PDF Processing Components (PdfEditor, Scanner)
• Utility Components (ExifReader, FileExtensions)
c. Data/Model Layer:
• Models (PdfFile)
• File System Integration
• Camera Integration
Key Architectural Elements
┌─ UI Layer ─────────────────┐
• ┌─ Fragments ────────────┐ │
• HomeFragment │ │
• CameraFragment │ │
• PdfEditorFragment │ │
• OcrFragment │ │
• PerspectiveCorrection │ │
• ┘ │
• ┌─ Composables ─────────┐ │
• PdfPageLayout │ │
• Dialogs │ │
• ┘ │
• ┬──────────┘
┌──────────────▼──────────┐
• ViewModel Layer │
• CameraViewModel │
• HomeViewModel │
• PdfEditorViewModel │
• ┬──────────┘
┌──────────────▼──────────┐
• Business Logic │
• PdfEditor │
• Scanner │
• Utilities │
• ┬──────────┘
┌──────────────▼──────────┐
• Data Layer │
• PdfFile Model │
• File System Access │
• Camera Integration │
• ┘
Important Relationships to Highlight
• Navigation flow between fragments (using navigation_graph.xml)
• Data flow from Camera to PDF processing
• PDF manipulation operations
• File system interactions
External Dependencies
• iText Library integration
• Android Camera API
• File System API
• OCR functionality
Additional Elements
• Permission handling
• File storage locations
• Error handling flow
• User interaction paths