[Feature][Android] Add fixed Lynx viewport support - #120
Open
Huxpro wants to merge 1 commit into
Open
Conversation
Summary of change: - Add a typed positive physical-pixel viewport for schemes and native hosts. - Apply exact preset measure specs before LynxView construction and fixed child layout params. - Match Legacy last-valued duplicate width and height query semantics. - Preserve full-size defaults while ignoring incomplete or unsafe raw dimensions. - Cover parsing, precedence, builder specs, hosted layout, and rendered device flow. - Document scheme and programmatic Android APIs in English and Chinese. TEST: /home/xuan.huang/.gradle/wrapper/dists/gradle-8.2-all/6mxqtxovn2faat1idb7p6lxsa/gradle-8.2/bin/gradle :sparkling:testDebugUnitTest --tests com.tiktok.sparkling.SparklingLynxViewportTest --tests com.tiktok.sparkling.SparklingViewTest --tests com.tiktok.sparkling.utils.SchemeParserTest --tests com.tiktok.sparkling.hybridkit.lynx.LynxKitInitParamsTest --no-daemon TEST: PATH=/tmp/sparkling-ktlint-bin:$PATH scripts/lint.sh kotlin TEST: /home/xuan.huang/.gradle/wrapper/dists/gradle-8.2-all/6mxqtxovn2faat1idb7p6lxsa/gradle-8.2/bin/gradle :app:assembleDebugAndroidTest --no-daemon Co-authored-by: TRAE CLI <noreply@bytedance.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a typed fixed Lynx viewport for Android Sparkling pages, preserving the historical physical-pixel
width+heightbehavior without exposingLynxViewBuilder.This is the second layer of the Android compatibility stack and depends on #119.
Related issues
Standalone compatibility enhancement for host containers migrating legacy Lynx launch URLs.
Changes
SparklingLynxViewportfor positive physical-pixel dimensions.widthandheightwith Legacy-compatible last-valued duplicate semantics.How to test
cd packages/playground/android && ./gradlew :sparkling:testDebugUnitTest --tests com.tiktok.sparkling.SparklingLynxViewportTest --tests com.tiktok.sparkling.SparklingViewTest --tests com.tiktok.sparkling.utils.SchemeParserTest --tests com.tiktok.sparkling.hybridkit.lynx.LynxKitInitParamsTest --no-daemoncd packages/playground/android && ./gradlew :app:assembleDebugAndroidTest --no-daemonPATH=/tmp/sparkling-ktlint-bin:$PATH scripts/lint.sh kotlinCloud-device execution of
FixedLynxViewportInstrumentedTestwill be attached before this PR is considered complete.Stack
Checklist
CONTRIBUTING.md.Device validation complete
The durable SG1 + Lynx Sandbox acceptance matrix is now available in #131. Exact validated commit:
8a2b3ea99eaa342e2f1ebfe716aefbb44f411fbb. On a fresharies_10device (Android 10 / API 29), all 9 tests passed, including real first-screen rendering, fixed320x480, shared density3.25across two independent Lynx views,PART_ON_LAYOUT, typed template fetch invocation, orientation, retry recovery, and unsafe configuration rejection. The runner dynamically leases/releases the device and archives logs/screenshots/hashes. Evidence archive on SG1:/tmp/sparkling-android-device-acceptance-8a2b3ea.tar.gz(SHA-25609acd64b4b63988b61e7f4f2ff11f3f7b4b4770bd3ef74a973db6dda0c9e242c).Expanded durable device validation
The checked-in SG1 + Lynx Sandbox matrix in #131 now validates exact commit
df875a87541d587ab8aa84a86600c0610f9e44c7with 10/10 PASS onaries_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 forALL_ON_UI,MOST_ON_TASM,PART_ON_LAYOUT, and safeMULTI_THREADS; and full-page fixed-viewport +MULTI_THREADSrejection 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-256712a3b83dbd78eabeae9afc0766b5b191cee0bff10e515967b3ae9f46c4feb98.