Skip to content

Add opt-in standard Android stylus capture and editing controller - #8

Draft
josephm1 wants to merge 1 commit into
imedwei:mainfrom
josephm1:codex/standard-android-ink
Draft

josephm1 wants to merge 1 commit into
imedwei:mainfrom
josephm1:codex/standard-android-ink

Conversation

@josephm1

Copy link
Copy Markdown

Generic Android hosts currently need to implement their own stylus/Canvas fallback when no vendor overlay attaches. This draft adds InkControllerFactory.createStandard(), an opt-in public-API controller adapted from the implementation used in Kalamos Notes and our Android KOReader adaptation. Existing create() Bigme/Onyx selection and the Noop path are unchanged.

The controller handles stylus input, historical samples, pressure and dashed trails, bounded writing areas, excluded controls and capture-only gestures for host-owned selection/checkbox/eraser behavior. It retains authoritative page pixels, supports cropped chrome updates and transparent replacement, batches presentation per MotionEvent and completes active strokes once when paused or detached. An optional InkEditingController extends the existing contract without adding requirements to vendor implementations.

This is a focused first contribution from Kalamos InkSDK, not a replacement of the upstream architecture. Broader Bigme lifecycle/composition changes and our device-provider registry remain in that adaptation for separate discussion. Credit remains with Ed Wei (imedwei) and InkSDK contributors. The new controller/interface/test carry GPL-3.0-only notices and the full licence; the contribution does not relicense existing upstream files.

Validation

  • All 30 inkcontroller unit tests pass, including nine new standard-controller checks and the factory check. Coverage includes capture without a dot, excluded controls/fingers, cropped updates, transparent replacement, final-UP pixels, cancellation/reentry, invalid attachment and historical sample order/pressure/timestamps.
  • :demo:assembleDebug passes. Existing vendor selection tests continue to pass.
  • Staged credential scan: zero findings; no device data, APKs, credentials or workstation paths added.
  • Local validation used the unchanged upstream dependency versions with a temporary repository-order/filter init script to avoid slow unrelated repository lookups. That machine-specific script is not part of this PR.

This implementation uses ordinary SurfaceView composition; it does not claim hardware-overlay latency or e-ink waveform equivalence. Device acceptance is owner-run. The README documents surface lifecycle, authoritative page synchronization and the requirement to deliver each event through either View dispatch or explicit forwarding once, never both. The existing demo is built unchanged; this PR does not silently switch its vendor factory to the opt-in controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant