Android application theme change smoothly

…衆ロ難τιáo~ 提交于 2020-06-26 21:22:44

问题


I am working on a project where day and night themes available.

I am changing themes by

night theme:

AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)

day theme:

AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)

But to see the changes in that activity/app, I need to restart app or recreaate that activity by recreate() but this is taking time and its not smooth like whatsApp or Telegram.

So how could I change theme of app smoothly that looks beautiful on theme change?

来源:https://stackoverflow.com/questions/60829884/android-application-theme-change-smoothly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!