bluelinelabs / Conductor

A small, yet full-featured framework that allows building View-based Android applications
Apache License 2.0
3.9k stars 343 forks source link

Prevent composition from being destroyed when participating in AndroidX transition #694

Open oleksandr-semenov opened 5 months ago

oleksandr-semenov commented 5 months ago

This is just a demo of the required changes.

When ChangeHandler uses AndroidX transition, composition gets ON_DESTROY callback and gets disposed. After Compose View gets attached again to window overlay it won't restart composition because ViewTreeLifecycle is destroyed. This causes the view to disappear.

Changes:

Android behavior with a plain project that uses scene transitions and compose views has the same re-start beavahior