QUESTIONS

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

  Abubakar Ib       2021/09/07       126


126

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
126 votes

SOLUTIONS: (2)

0
      16

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
      19

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