Commit Graph

15 Commits

Author SHA1 Message Date
61aaa9ebde Fix grid evenness, line snap, and viewport clamping
Grid:
- Draw grid in screen space with pixel-snapped positions, fixing
  the uneven rectangles caused by sub-pixel positioning in canonical space
- 1px screen-space lines for uniform weight at any zoom level

Line snap:
- Track max distance from origin (not per-move), increase threshold
  to 60pt (~5mm) to handle EMR stylus hand tremor
- Snap timer stays active until pen moves significantly from start

Viewport:
- Clamp pan so page always covers the full viewport
- Background changed to white (no dark gray borders)
- Page centers when smaller than viewport (e.g., zoomed out landscape)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:08:58 -07:00
e8091ba081 Fix rendering quality and add line snap + box tool
Rendering fixes for e-ink displays:
- Remove backing bitmap (was 1/4 resolution, caused blurry strokes)
- Draw strokes directly as paths for pixel-perfect rendering
- Disable anti-aliasing on stroke and grid paint (no edge fading)
- Grid: darker color (rgb 180,180,180), 2pt stroke width for crispness

New features:
- Line snap: hold pen still for 1.5s to snap to straight line from origin
- Box tool: draw rectangles by dragging corner to corner

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:02:18 -07:00
39adcfaaa4 Implement Phase 10: e-ink polish and finalize project docs
- High-contrast theme with expanded color palette for e-ink readability
- Updated source trees in DESIGN.md
- Updated PROJECT_PLAN.md and PROGRESS.md — all phases complete
  (only on-device performance profiling remains)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:51:52 -07:00
351a7596be Implement Phase 9: PDF export via share intents
- PdfExporter: creates PdfDocument, scales 300 DPI canonical coords to
  72 DPI PDF points, renders strokes without grid
- Share via Intent.ACTION_SEND + FileProvider
- PDF button in editor toolbar exports current page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:49:32 -07:00
47b6ffc489 Implement Phase 8: multi-page navigation
- PageListScreen: adaptive grid of page cards with correct aspect ratio
- PageListViewModel: pages flow + add page
- NavGraph: pages route loads notebook metadata, shows PageListScreen,
  tap page navigates to editor with page size parameter

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:46:48 -07:00
34ad68d1ce Implement Phase 7: rectangle selection with move, copy, delete
- Rectangle selection via stylus drag in select mode
- Visual feedback: dashed selection rect, blue highlight on selected strokes
- Operations: delete selection, drag-to-move, copy (toolbar buttons)
- Full undo support: DeleteMultipleStrokesAction, MoveStrokesAction,
  CopyStrokesAction
- Preallocated RectF to avoid draw-time allocations (lint)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:45:04 -07:00
5eeedff464 Implement Phase 6: undo/redo with command pattern
- UndoableAction interface with AddStrokeAction and DeleteStrokeAction
- UndoManager: undo/redo stacks (depth 50), canUndo/canRedo StateFlows
- EditorViewModel: stroke operations routed through UndoManager,
  visual callbacks sync canvas view without full DB reload
- Toolbar: undo/redo buttons with enabled state
- 9 unit tests for UndoManager

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:40:24 -07:00
7cf779934d Implement Phase 5: stroke-level eraser
- Eraser mode: stylus touch/drag hit-tests against stroke bounding boxes
  expanded by 42pt radius (~3.5mm), processes historical points
- Deletes hit strokes from canvas view and Room DB
- Backing bitmap rebuilt automatically on stroke removal

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:36:35 -07:00
3fc9751fc4 Implement Phase 4: pinch-to-zoom and finger pan
- ScaleGestureDetector for pinch zoom (0.5x-4x) with focal-point anchoring
- Finger drag for pan with multi-pointer tracking
- Zoom/pan state managed locally in PadCanvasView for responsiveness,
  synced to EditorViewModel on gesture end

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:34:42 -07:00
a31e7e64d0 Upgrade to Gradle 9.4.1, AGP 9.1.0, Kotlin 2.3.20
- Gradle wrapper 8.14.2 -> 9.4.1
- AGP 8.10.1 -> 9.1.0 (built-in Kotlin, no separate kotlin.android plugin)
- Kotlin 2.1.20 -> 2.3.20
- KSP 2.1.20-1.0.32 -> 2.3.6 (new versioning scheme)
- settings.gradle.kts: removed @Suppress for dependencyResolutionManagement
- gradle.properties: added android.disallowKotlinSourceSets=false for KSP compat

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:30:15 -07:00
2fc4224f5a Implement Phase 3: canvas drawing with stylus input
- PadCanvasView: custom View with stylus event handling (historical points
  for smoothness), Path/Paint stroke rendering, backing bitmap at 1/4
  resolution, 60pt grid drawing, Matrix coordinate transform
- CanvasState: tool modes (fine/medium pen, eraser, select), zoom/pan state
- EditorViewModel: loads/saves strokes to Room on completion
- EditorScreen: Compose wrapper with AndroidView + FilterChip toolbar
- NavGraph: pages route auto-navigates to first page editor, page size
  passed through route params

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:21:17 -07:00
644b8a4732 Implement Phase 2: notebook list screen with navigation
- NotebookListScreen: lazy list, create dialog (title + page size),
  long-press delete with confirmation, empty state
- NotebookListViewModel: StateFlow-based, create/delete operations
- EngPadTheme: high-contrast light scheme for e-ink displays
- NavGraph: three routes (notebooks, pages stub, editor stub)
- MainActivity wired to NavHost with database injection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:15:48 -07:00
8f41c41589 Add Makefile with build, test, run, and devrun targets
Makefile wraps Gradle commands and adds emulator/device launch targets:
- run: builds, starts DC-1 emulator if needed, installs and launches
- devrun: builds, installs and launches on connected USB device
- Updated CLAUDE.md and DESIGN.md source trees

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:14:08 -07:00
0b53023a25 Implement Phase 1: project skeleton and data layer
Android project with Kotlin, Jetpack Compose, and Room. Includes:
- Gradle build system with version catalog, foojay JDK resolver, lint config
- Room entities (Notebook, Page, Stroke) with packed float BLOB encoding
- DAOs and repositories for all entities
- Unit tests for blob roundtrip and PageSize enum (10 tests, all passing)
- Minimal Application class and stub MainActivity

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:03:57 -07:00
47778222b7 Add project documentation: design spec, implementation plan, and progress tracking
Initial project setup with README, CLAUDE.md (AI dev context), DESIGN.md
(full technical design covering architecture, data model, coordinate system,
rendering strategy), PROJECT_PLAN.md (phased implementation steps), and
PROGRESS.md (completion tracking).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 13:42:44 -07:00