Skip to content

SystemUI: fix custom lockscreen clocks across rotation - #1382

Open
DubheBroken wants to merge 1 commit into
crdroidandroid:16.0from
DubheBroken:lockscreen-clock-fix
Open

DubheBroken wants to merge 1 commit into
crdroidandroid:16.0from
DubheBroken:lockscreen-clock-fix

Conversation

@DubheBroken

Copy link
Copy Markdown

Fix the custom lockscreen clock disappearing when switching from portrait to landscape, and shifting to the right after switching back to portrait.

Have the default layout and the landscape split-shade layout share the same clock section, avoiding missed constraints during transitions that cause the clock width to become 0. Also continuously update the scale pivot based on the effective layout size, preventing the enlarged clock from shifting due to a stale incorrect pivot, while preserving AOD animation control over the scale.

Rebuilt and flashed on Xiaomi Pad 5 Pro Wi-Fi (elish), confirming the lockscreen is back to normal.

Share KeyguardClockStyleSection across default and split-shade blueprints.
Blueprint transitions preserve same-class sections, so an unscoped instance
can otherwise skip clock constraints with its enabled state uninitialized,
collapsing the retained clock to zero width in landscape.

Keep observing clock layout changes and recenter the scale pivot whenever
the width settles. Ignore zero-width layouts and update only the pivot
during later layouts so AOD scale animations retain control of the scale.
This prevents a stale zero pivot from shifting a 150% clock to the right
when returning to portrait. Remove the listener on replacement and detach.

Validation: captured both failures on elish; diff checks passed. The user
confirmed the lockscreen works after rebuilding and flashing the fix.

(cherry picked from commit f4d5a93eec80a3afe16035902002e0096affd58d)
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.

1 participant