Skip to content

Fix overlay crash on edge-to-edge Compose activities; add endless feed sample - #18

Merged
abhishek-3289 merged 2 commits into
mainfrom
sample-endless-feed
Oct 25, 2026
Merged

abhishek-3289 merged 2 commits into
mainfrom
sample-endless-feed

Conversation

@abhishek-3289

Copy link
Copy Markdown
Collaborator

What changed

  • Fix: crash on edge-to-edge Compose activities. DevDeck.install added its overlay ComposeView in onActivityStarted, before the window was attached. On recent Android an edge-to-edge window can measure it before attaching it, which crashes with "Cannot locate windowRecomposer; … is not attached to a window" (Android Studio's new-project template calls enableEdgeToEdge(), so many apps would hit this; 1.0.0 is affected). The overlay is now added once the window is attached, posted so it isn't added mid attach pass, and never to a finishing or destroyed activity.
  • Sample: endless feed screen. Open endless feed (try a long screenshot) on the main screen opens a Compose list that loads 20 more items whenever you reach the bottom, with numbered, coloured items so seams or repeats in a long screenshot are easy to spot. It's attached through includeActivity, which is how the crash above was found.

How it was tested

  • ./gradlew ktlintFormat ktlintCheck lintDebug lintRelease testDebugUnitTest assembleDebug assembleRelease publishToMavenLocal apiCheck :sample:assembleQa passes.
  • Pixel 10 Pro emulator (API 37): the feed crashed with enableEdgeToEdge() before/after super.onCreate() and opens fine with the fix; the main (hosted) and View-based screens still get the drawer; no crashes in the crash buffer.
  • Long screenshot on the feed: from item 7 with one page loaded it captures to the end of loaded content plus the spinner (1280×4040) and scrolls back; with ~26 pages loaded, from item 173 it stops at the pixel budget (1280×12114, items 173–221 in order, no repeats); no crash.

Checklist

  • Entry added under [Unreleased] in CHANGELOG.md (or the skip-changelog label is set)
  • ./gradlew ktlintFormat ktlintCheck lintDebug testDebugUnitTest passes
  • README / sample README updated if the public API or behaviour changed
  • Screenshots attached for UI changes

@abhishek-3289 abhishek-3289 added this to the v1.1.0 milestone Oct 25, 2026
@abhishek-3289
abhishek-3289 merged commit 0479730 into main Oct 25, 2026
3 checks passed
@abhishek-3289
abhishek-3289 deleted the sample-endless-feed branch October 25, 2026 01:12
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.

2 participants