Skip to content

Clamp negative cursor animation duration in AndroidViewContainer#2632

Open
AndreiGorelov wants to merge 2 commits intoCoderLine:developfrom
AndreiGorelov:feature/issue-2616
Open

Clamp negative cursor animation duration in AndroidViewContainer#2632
AndreiGorelov wants to merge 2 commits intoCoderLine:developfrom
AndreiGorelov:feature/issue-2616

Conversation

@AndreiGorelov
Copy link
Copy Markdown

@AndreiGorelov AndreiGorelov commented Apr 2, 2026

Issues

Fixes #2616

Proposed changes

In AndroidViewContainer.transitionToX, clamp the animation duration with positive values before calling Animation.setDuration, so Android never throws IllegalArgumentException: Animation duration cannot be negative when playback, autoscroll, and user scrolling interact (e.g. off-screen).
This is a defensive platform fix.

Checklist

  • I consent that this change becomes part of alphaTab under it's current or any future open source license
  • Changes are implemented
  • New tests were added

No new automated tests: the failure depends on Android animation APIs and a manual playback and scroll scenario. Verified manually with real devices.

Further details

  • This is a breaking change
  • This change will require update of the documentation/website

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.

Android Animation duration cannot be negative in AndroidViewContainer.transitionToX

1 participant