Skip to content

Fix Android toast animations and shadow rendering - #10

Merged
victorycodedev merged 1 commit into
mainfrom
fix/android-animations-and-shadows
Nov 20, 2026
Merged

victorycodedev merged 1 commit into
mainfrom
fix/android-animations-and-shadows

Conversation

@victorycodedev

Copy link
Copy Markdown
Owner

What changed?

  • Reworked Android toast visibility transitions so cards keep a stable measured layout while opacity, translation, scale, spring, pop, bounce, snap, and reveal effects animate independently.
  • Disabled device/ROM window animations on the activity-scoped ToastKit overlay so Android cannot add a competing slide transition.
  • Delayed Compose entrance transitions until the overlay window is visible, preserving the full animation rather than consuming its first frames behind a transparent window.
  • Matched entrance and dismissal behavior for directional and spring-based animations.
  • Added directional reveal behavior without resizing the WRAP_CONTENT overlay window.
  • Extended Android exit lifetimes for snap and pop so their spring animations complete before cleanup.
  • Reserved transparent space around toast cards so shadows fade naturally instead of being clipped into a rectangular band.
  • Preserved activity-scoped overlay ordering, keyboard behavior, touch pass-through, swipe dismissal, action callbacks, and existing PHP APIs.

Why?

After moving Android toasts into activity-scoped WindowManager overlays, the host window and Compose AnimatedVisibility both contributed motion. Because the bottom overlay was WRAP_CONTENT, collapsing and expanding its layout made fade, scale, spring, pop, and reveal frequently resemble the same slide animation. Window-level animations also varied between emulators and physical devices. Shadow blur was clipped at the compact window boundary.

This change gives ToastKit a stable animation canvas while retaining the overlay architecture required to draw above dialogs, sheets, and detached LayoutKit tab bars.

How was it tested?

Automated checks:

  • composer test — 194 tests, 389 assertions passed.
  • ./gradlew :app:compileDebugKotlin in the generated LayoutKit playground Android project.
  • php artisan native:plugin:validate /Users/efekpoguavictory/plugins/toastkit.
  • git diff --check.

Manual/runtime checks:

  • Compared Android and iOS recordings frame by frame.
  • Tested all animation styles and their dismissal phases on an Android emulator and a physical Android phone.
  • Verified fade, slide, scale, spring, snap, pop, reveal, and bounce remain visually distinct.
  • Verified directional animations return through the same edge used for entrance.
  • Verified shadows render as a soft fade without the rectangular clipped band.
  • Rechecked LayoutKit overlay behavior, modal and bottom-sheet ordering, keyboard interaction, swipe dismissal, and rotation/background restoration.

Platforms tested

  • PHP
  • JavaScript
  • Android
  • iOS
  • Not applicable / documentation only

Breaking changes?

None. The PHP API, payload contract, animation names, directions, positions, timing configuration, and event behavior remain compatible.

Checklist

  • Tests were added or updated where appropriate.
  • Existing relevant tests pass.
  • Documentation was updated where necessary.
  • Public API and event/bridge compatibility were considered.
  • Android/iOS behavior parity was considered where relevant.
  • No unnecessary native dependencies were introduced.
  • No secrets, tokens, temporary logging, or debugging code were committed.
  • Native changes were tested in a generated NativePHP application where practical.

@victorycodedev
victorycodedev merged commit 317f849 into main Nov 20, 2026
2 checks passed
@victorycodedev
victorycodedev deleted the fix/android-animations-and-shadows branch November 20, 2026 21:19
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