Repository navigation
Fold-aware layouts and Form fold semantics - #6402
Open
shai-almog wants to merge 6 commits into
Open
shai-almog wants to merge 6 commits into
shai-almog wants to merge 6 commits into
Conversation
…ntics Layouts declare how a form responds to a fold or posture change (FOLD_IGNORE / FOLD_REVALIDATE / FOLD_ANIMATE) and read the hinge through FoldState. The current form listens for posture changes, calls onFoldChanged and revalidates or animates its content pane accordingly. Adds animation screenshot tests for book, table-top and flip folds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gate fixes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e hinge, padded split, hidden collapsed pane) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…out bounds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tent pane Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Golden capture needs attentionTest iOS UI build scripts capture was cancelled; re-run Golden capture Whatever did arrive is committed; the next push captures only what is still missing. A test that cannot render on some port needs a Run at |
…e prefix Form.postureListener's class, Form$PostureListener, starts with the Form prefix; the addComponent fallback took it for the form and rebuilt its content pane with a FlowLayout, blanking the Chart2 animation screenshots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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
Codename One already reports fold state (
DevicePosture, posture listeners, simulator and Android support), but nothing in the UI reacted to it. This PR adds fold-aware layouts and makes forms respond to folds.Layoutfold behaviour:getFoldBehavior()returnsFOLD_IGNORE(the default, so existing layouts are unchanged),FOLD_REVALIDATEorFOLD_ANIMATE.getFoldAnimationDuration()sets the animation length.setFoldState/getFoldStateread the hinge through the newFoldStatesnapshot, which is relative to the container. A fixed state can stand in for the device (previews, virtual hinges, tests).FoldLayout: a primary and a secondary pane. With a vertical hinge (book or dual screen) the panes sit side by side with the hinge left empty. With a horizontal hinge (flip or table-top) the primary goes above and the secondary below. With no fold, a fallback applies: primary only, stacked, or split.FoldAvoidingLayout: wraps any layout and fits each half of the container to its own side of the hinge.Form: listens for posture changes while it owns the surface. It ignores events where the fold itself hasn't changed, callsonFoldChanged(FoldState), then animates or revalidates the content pane according to its layouts. It revalidates instead of animating when reduced motion is on. A form whose content pane usesFoldLayoutdoesn't scroll.FoldStateso the frames match on every port:FoldBookOpenScreenshotTest: a list/detail screen opening across a vertical hinge.FoldTableTopScreenshotTest: a media screen moving into table-top posture.FoldAvoidingGridScreenshotTest: a grid splitting around a vertical hinge.FoldFlipGridScreenshotTest: a grid splitting around a horizontal hinge.Testing
FoldLayoutTest,FormFoldBehaviorTest) cover pane geometry for each posture and fallback, no child under the hinge, switching a container's layout without losing children, the padded split, the live device fold through the test implementation, ignoring repeated events, panes filling a non-scrolling form, and the listener being removed when the form is no longer showing.scripts/pre-push-gates.sh --fullpasses. The steps it lists as NOT RUN are CI-only.🤖 Generated with Claude Code