QUESTIONS

Trying to Add Night Mode Feature to my App using Aide ide

  Abubakar Ib       2021/09/07       205


205

The question and answer about this post on Trying to Add Night Mode Feature to my App using Aide ide have a total of 2 answer so far..

asked
2 answers
205 votes

SOLUTIONS: (2)

0
      29

Just add this into your apps.
-----
AppDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES) 
----
u can use :
MODE_NIGHT_NO
MODE_NIGHT_AUTO
MODE_NIGHT_FOLLOW_SYSTEM

-----
Change your theme to:
Theme.AppCompat.DayNight

-----
Create a folder named value-night and create styles.xml file and customize your night color inside.

----
Your night mode reset every time you close your app. Use shared preference to store value and load your theme every time your app run..
To check status, u can use :
int mode = AppCompatDelegate.getDefaultNightMode();

0
      32

you may use setTheme + recreae() for that, then add sharedpreferences to store changes


QUESTIONS:


Nfiles Questions - nfiles.xyz the Q nad A blogs sites for free
πŸ—‚ Nfiles Β» Home
πŸ—‚ ModStore
πŸ—‚ Videos
πŸ—‚ Shareurl
πŸ—‚ About us
πŸ—‚ Bitcoin

Connecting...
πŸ‘€ Mr. snow finger
πŸ‘€ Yoki No moto
πŸ‘€ Xdeveloper
πŸ‘€ Malitanyo Dev
πŸ‘€ Money Motto
πŸ‘€ Ako Johnny Sin
Create with ❀ Questions by nfiles.xyz 2021