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:
Telegram (From Dark to Light)
Telegram (From Light to Dark)
VK (From Light to Dark)
VK (From Dark to Light)
since telegram is an open source app you can find the code -> line 3154: github. it seems that it converts layout into bitmap and use it with an existing imageView to animate circular reveal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With