Skip to content

bug(android): continuous pages past the second page do not activate for drawing #21

@markm39

Description

@markm39

Current state

The feat/android-parity branch brings Android much closer to the shared iOS surface: native drawing is mostly working, eraser responsiveness is now good, selection/event parity is improved, Android export/body helpers are filled in, and the example has Android run docs.

Blocker

In the Android example, continuous notebook pages past roughly the second page still do not reliably activate for drawing. The page is visible after scrolling, but the pooled native canvas either is not mounted/reassigned correctly, is not receiving touches, or is loaded before the Android GLSurfaceView/native engine is truly ready.

There was also a related growth bug where scrolling could create pages endlessly. The branch now separates programmatic blank-page loads from user clear() so blank assignment does not emit onDrawingChange, but this still needs device verification with the page activation fix.

Expected behavior

Match iOS:

  • The continuous notebook uses the fixed-size native engine pool and reassigns slots as the visible page changes.
  • Every visible page, including page 3 and beyond, can receive ink after scrolling to it.
  • Scrolling alone never marks a blank page dirty.
  • The notebook keeps exactly one blank page after the last page with real content/strokes.
  • Dirty page capture preserves strokes when a slot is reassigned.

Repro

cd example
npx expo run:android --device

Then draw on page 1, move to later pages, and try to draw on page 3+.

Useful files

  • src/InfiniteInkCanvas.tsx
  • src/ContinuousEnginePool.tsx
  • src/ZoomableInkViewport.tsx
  • android/src/main/java/com/mathnotes/mobileink/MobileInkCanvasView.kt
  • android/src/main/java/com/mathnotes/mobileink/MobileInkModule.kt
  • example/App.tsx

Done when

  • Android can draw on page 1, page 2, and page 3+ after normal scrolling.
  • Page count only grows after strokes/content are added to the current trailing blank page.
  • Capturing/reassigning dirty pages preserves drawing data.
  • The behavior is verified on a real Android device or emulator.
  • Relevant JS tests are added or updated for page growth / pool reassignment where possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions