Skip to content

feat(InteractionDialog): custom animations + code-set duration (#5072)#5097

Merged
shai-almog merged 2 commits into
masterfrom
fix/5072-interaction-dialog-custom-animations
May 29, 2026
Merged

feat(InteractionDialog): custom animations + code-set duration (#5072)#5097
shai-almog merged 2 commits into
masterfrom
fix/5072-interaction-dialog-custom-animations

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

  • Adds setAnimationSpeed(int) / getAnimationSpeed() so callers can override the interactionDialogSpeedInt theme constant in code (default -1 defers to the theme).
  • Adds 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(), and disposeTo() now route through a single resolveAnimationSpeed() helper that honors the new speed setter, and invoke the setup callbacks when set.
  • Documents the arrow-missing-during-slow-animation side-effect from RFE: support setting custom animations for showing/hiding the InteractionDialog and set animation duration in code #5072 in the new setShowAnimationSetup javadoc, 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=InteractionDialogTest passes (14/14, including 4 new tests covering speed defaults, the speed setter round-trip, and the show/dispose setup callbacks firing exactly once)
  • Manual: confirm a slow (3s) custom-translated popup keeps its pointing arrow visible for the whole animation

🤖 Generated with Claude Code

…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>
@github-actions
Copy link
Copy Markdown
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>
@shai-almog shai-almog force-pushed the fix/5072-interaction-dialog-custom-animations branch from d1cea7c to da7b09e Compare May 29, 2026 16:52
@github-actions
Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 29, 2026

Compared 30 screenshots: 30 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 248 seconds

Build and Run Timing

Metric Duration
Simulator Boot 72000 ms
Simulator Boot (Run) 0 ms
App Install 12000 ms
App Launch 15000 ms
Test Execution 1505000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 29, 2026

Compared 122 screenshots: 122 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 196 seconds

Build and Run Timing

Metric Duration
Simulator Boot 67000 ms
Simulator Boot (Run) 1000 ms
App Install 13000 ms
App Launch 4000 ms
Test Execution 317000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 654.000 ms
Base64 CN1 encode 1369.000 ms
Base64 encode ratio (CN1/native) 2.093x (109.3% slower)
Base64 native decode 392.000 ms
Base64 CN1 decode 1009.000 ms
Base64 decode ratio (CN1/native) 2.574x (157.4% slower)
Base64 SIMD encode 416.000 ms
Base64 encode ratio (SIMD/native) 0.636x (36.4% faster)
Base64 encode ratio (SIMD/CN1) 0.304x (69.6% faster)
Base64 SIMD decode 421.000 ms
Base64 decode ratio (SIMD/native) 1.074x (7.4% slower)
Base64 decode ratio (SIMD/CN1) 0.417x (58.3% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 59.000 ms
Image createMask (SIMD on) 11.000 ms
Image createMask ratio (SIMD on/off) 0.186x (81.4% faster)
Image applyMask (SIMD off) 123.000 ms
Image applyMask (SIMD on) 59.000 ms
Image applyMask ratio (SIMD on/off) 0.480x (52.0% faster)
Image modifyAlpha (SIMD off) 117.000 ms
Image modifyAlpha (SIMD on) 56.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.479x (52.1% faster)
Image modifyAlpha removeColor (SIMD off) 135.000 ms
Image modifyAlpha removeColor (SIMD on) 76.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.563x (43.7% faster)
Image PNG encode (SIMD off) 958.000 ms
Image PNG encode (SIMD on) 838.000 ms
Image PNG encode ratio (SIMD on/off) 0.875x (12.5% faster)
Image JPEG encode 537.000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 29, 2026

Compared 122 screenshots: 122 matched.

Native Android coverage

  • 📊 Line coverage: 12.84% (7475/58229 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 10.44% (37414/358503), branch 4.33% (1467/33874), complexity 5.42% (1763/32544), method 9.47% (1444/15249), class 15.57% (331/2126)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 12.84% (7475/58229 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 10.44% (37414/358503), branch 4.33% (1467/33874), complexity 5.42% (1763/32544), method 9.47% (1444/15249), class 15.57% (331/2126)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 825.000 ms
Base64 CN1 encode 184.000 ms
Base64 encode ratio (CN1/native) 0.223x (77.7% faster)
Base64 native decode 896.000 ms
Base64 CN1 decode 216.000 ms
Base64 decode ratio (CN1/native) 0.241x (75.9% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog shai-almog merged commit 5dfcb77 into master May 29, 2026
21 of 22 checks passed
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.

RFE: support setting custom animations for showing/hiding the InteractionDialog and set animation duration in code

1 participant