Skip to content

[Feature][Android] Add pre-load Lynx view lifecycle - #119

Merged
YJ-Hao merged 1 commit into
tiktok:mainfrom
Huxpro:agent/android-lynx-builder-config
Aug 11, 2026
Merged

[Feature][Android] Add pre-load Lynx view lifecycle#119
YJ-Hao merged 1 commit into
tiktok:mainfrom
Huxpro:agent/android-lynx-builder-config

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add a Java-friendly pre-load Lynx view lifecycle seam for Android hosts.

This is a deliberately narrow foundation layer. It does not expose LynxViewBuilder or add thread, viewport, density, resource-fetcher, module, or background-runtime behavior.

Related issues

Standalone host-integration enhancement. Follow-up PRs will implement and validate individual capabilities directly in HybridLynxKit; density will use a separate shared-process policy.

Changes

  • Add SparklingLynxViewCreatedListener to SparklingContext.
  • Invoke it after Sparkling initializes its bridge and before onPostKitCreated or template loading.
  • Preserve existing behavior when no listener is installed.
  • Test callback ordering, bridge availability, created-view identity, and the default unset path.

How to test

  • cd packages/playground/android && ./gradlew :sparkling:testDebugUnitTest --tests com.tiktok.sparkling.hybridkit.HybridKitTest --no-daemon
  • PATH=/tmp/sparkling-ktlint-bin:$PATH scripts/lint.sh kotlin

Both checks passed on the Android devbox using ktlint 1.8.0, matching CI.

Checklist

  • I read CONTRIBUTING.md.
  • I explained why this is standalone.
  • I ran relevant checks.
  • I updated API documentation in code.
  • I added/updated tests.

Expanded durable device validation

The checked-in SG1 + Lynx Sandbox matrix in #131 now validates exact commit df875a87541d587ab8aa84a86600c0610f9e44c7 with 10/10 PASS on aries_10 (Android 10 / API 29). Added runtime coverage includes: the pre-load listener observing a ready bridge before template fetch; the global per-page fetcher factory; real first-screen rendering for ALL_ON_UI, MOST_ON_TASM, PART_ON_LAYOUT, and safe MULTI_THREADS; and full-page fixed-viewport + MULTI_THREADS rejection before Activity launch or transfer-station save. The runner requires a clean exact HEAD and fails closed unless Sandbox release confirms the leased serial. Evidence: /tmp/sparkling-android-device-acceptance-df875a8; archive SHA-256 712a3b83dbd78eabeae9afc0766b5b191cee0bff10e515967b3ae9f46c4feb98.

Summary of change:
- Expose a Java-friendly created-view listener on SparklingContext.
- Notify hosts after Sparkling bridge initialization and before post-create/load.
- Preserve existing behavior when no listener is provided.
- Cover callback order, bridge availability, view identity, and defaults.

TEST: ./gradlew :sparkling:testDebugUnitTest --tests com.tiktok.sparkling.hybridkit.HybridKitTest --no-daemon
TEST: PATH=/tmp/sparkling-ktlint-bin:$PATH scripts/lint.sh kotlin

Co-authored-by: TRAE CLI <noreply@bytedance.com>
@Huxpro Huxpro changed the title [Feature][Android] Add per-container Lynx view configurator [Feature][Android] Add pre-load Lynx view lifecycle Aug 8, 2026
@Huxpro
Huxpro force-pushed the agent/android-lynx-builder-config branch from 1184c8b to 9569434 Compare August 8, 2026 19:03
@Huxpro
Huxpro requested a review from YJ-Hao August 11, 2026 10:34
@YJ-Hao
YJ-Hao merged commit c4ce8d2 into tiktok:main Aug 11, 2026
10 checks passed
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