Skip to content

Scope appearance listener state per animator - #8352

Open
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/fix-reused-appearance-listeners
Open

Scope appearance listener state per animator#8352
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/fix-reused-appearance-listeners

Conversation

@OskarEichler

Copy link
Copy Markdown

Problem

BaseViewAppearanceAnimator reuses one show listener and one hide listener across every replacement animator. Each listener's cancellation flag is sticky: once a hide is interrupted by show, later hide animators inherit the cancelled state and permanently skip their end-state cleanup, leaving the view visible instead of gone.

Fix

Attach a fresh listener to each replacement animator so cancellation state belongs to exactly that animator. This removes shared mutable listener state and prevents old/new animator callbacks from contaminating one another.

Breaking changes

None. Completed animations retain their existing states; a later animation now completes normally after an earlier instance was cancelled.

Test plan

  • Added a regression that cancels hide with show, completes show, then runs a second hide and verifies View.GONE.
  • Exact baseline leaves the view VISIBLE; the fixed focused suite passes 9/9.
  • Full Android unit suite passes: 698 successes, 0 failures, 2 skipped.
  • git diff --check passes.

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