theme-daynight

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