feat(InteractionDialog): custom animations + code-set duration (#5072)#5097
Merged
shai-almog merged 2 commits intoMay 29, 2026
Merged
Conversation
…se setup (#5072) Allow callers to override the interactionDialogSpeedInt theme constant in code and to replace the built-in grow/shrink animation with custom positioning, addressing the request in #5072. The arrow-border-missing-during-slow-animation note in #5072 is a side-effect of the default reposition-from-1x1 animation: at the start of the animation the dialog is too small for the arrow image to render. The new setShowAnimationSetup docs include a translate-from-edge recipe that keeps the dialog at full size throughout, so the arrow stays visible. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Cloudflare Preview
|
…asserts PR #5092 routed lightweight Picker next/prev focus transfer through disposeToTheBottom(Runnable), and Done/Cancel still rely on the disposeToTheBottom() animation finishing, so the Next/Prev focus assertions and Done/Cancel "dialog closed" assertions in testPickerNextPrevButtons can no longer be checked synchronously after released() + flushEdt(). DisplayTest.flushEdt() by itself does not drive AnimationManager animations: it only iterates edtLoopImpl while shouldEDTSleepNoFormAnimation() is false, which is only the case when there is pending input or serial work. Queueing a no-op callSerially before each flushEdt forces one edtLoopImpl pass per loop iteration, which in turn runs Form.repaintAnimations and advances the dispose animation. The runAnimations helper now uses that pattern (with a longer 600ms budget to cover the 400ms dispose animation plus completion-callback latency), and a new runUntilFocusedOrEditing helper polls until the target picks up focus or starts editing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d1cea7c to
da7b09e
Compare
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 30 screenshots: 30 matched. Benchmark Results
Build and Run Timing
|
Collaborator
Author
|
Compared 122 screenshots: 122 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 122 screenshots: 122 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
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
setAnimationSpeed(int)/getAnimationSpeed()so callers can override theinteractionDialogSpeedInttheme constant in code (default-1defers to the theme).setShowAnimationSetup(Runnable)/setDisposeAnimationSetup(Runnable)to replace the built-in "grow from / shrink to 1x1" animation with a caller-supplied positioning of the dialog (or its parent) at the animation start/end state.show(),dispose(),resize(), anddisposeTo()now route through a singleresolveAnimationSpeed()helper that honors the new speed setter, and invoke the setup callbacks when set.setShowAnimationSetupjavadoc, with a translate-from-edge recipe that keeps the dialog full-size throughout the animation so the arrow renders the whole time.Fixes #5072.
Test plan
mvn test -Dtest=InteractionDialogTestpasses (14/14, including 4 new tests covering speed defaults, the speed setter round-trip, and the show/dispose setup callbacks firing exactly once)🤖 Generated with Claude Code