Repository navigation
fix(adaptive-window): refresh stale window bounds after configuration changes - #64
Merged
Merged
Conversation
Backport AndroidX 48413c3's pending-update flag and post-global-layout refresh for API 32 and below, covering SaltUI's supported API 23-32 range. Use the same WindowMetricsCalculator and supported-context unwrapping as AndroidWindowInfo so older Android versions retain window and split-screen semantics. Declare the existing Compose runtime dependency explicitly for compilation, keeping its current 1.5.0 baseline. Keep state on the host View, detach and restore listeners with its lifecycle, and retain upstream source references and Apache attribution. Android 33+ and other platforms keep their existing window information path. Require an actual hinge sensor to avoid misclassifying regular emulators as foldables. Enable Android resources for a collision-free View tag ID. Validation: module publication and SPA build passed; all 438 existing SPA unit tests passed. Android 12 runtime checks covered repeated rotation in the main and player screens. Earlier checks also covered window resizing, tablet layout, Activity recreation and locale retention. API 23-29 have not been runtime-verified; Android 16 emulator disconnects prevented validation.
Moriafly
force-pushed
the
fix/android12-adaptive-window
branch
from
October 24, 2026 06:41
21e7813 to
7bd23b4
Compare
Remove redundant parentheses around the safe cast in the View-tag state lookup to satisfy CodeFactor detekt.UnnecessaryParentheses. The safe cast still binds before the Elvis fallback, preserving state reuse and initialization behavior. Validation: :salt-adaptive-window:compileAndroidMain passed offline; git diff --check passed. This syntax-only change does not require additional tests.
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.
On Android API 32 and below, configuration changes can return stale window bounds. Adaptive layouts may retain the previous orientation after rotation, preventing phone landscape behavior from taking effect. This PR also fixes regular emulators being classified as foldables when they advertise the hinge-angle feature without exposing an actual hinge sensor.
Backport Google's pending-update flag and refresh window bounds after the next global layout pass. The condition matches upstream:
SDK_INT < TIRAMISU, covering API 23–32 within SaltUI's supported range. Window sizing uses the sameWindowMetricsCalculator, Context unwrapping, and unsupported-Context fallback as upstream to preserve window and split-screen semantics on older Android versions. Declareandroidx.window:window:1.5.0, already a Compose UI runtime dependency, explicitly for compilation.The host View owns the state. Listeners are removed on detach and restored on reattach. API 33+, Desktop, and iOS retain their existing paths. Upstream source references and Apache copyright notices are preserved.
Upstream fix: AndroidX 48413c3, addressing b/525259151, b/525284940, and b/508799456. Verified that Compose UI 1.13.0-alpha01 includes the fix, while the currently used 1.12.1 does not. The upstream compatibility range does not imply that the issue has been reproduced on every older Android version.
Validation: