I am using DayNight theme in my application. And I have a button that changes the theme. In VK and Telegram app there is a beautiful reveal animation that changes the theme without restarting activity or something like that.
I have tried to make that with reveal animation implementation in different ways, but it doesn't work or working bad in some cases with AppCompatDelegate.setDefaultNightMode(...). All examples with that reveal animation are for ActivityA -> ActivityB, but I just need to update theme without starting any activity.
And one more thing: AppCompatDelegate.setDefaultNightMode recreates my activity, so do I need a custom theme changing implementation?
And main question: how to create that animation with theme changing?
Examples: