-
Notifications
You must be signed in to change notification settings - Fork 0
Controlling what users view when users switch modes
Devrath edited this page May 28, 2021
·
1 revision
- We can achieve this using the styles having two values folder for
normal modeanddark moderes/values/styles.xmlres/values-night/styles.xml
- To create
values-nightfolder- Right-click on the values folder
- Select
newfrom the options. - In the available qualifiers select
Night-Modeand push to right using the middle selection arrows. - Then Select
Not Nightmode - Give the file name as
styles - Press
ok
- In the
res/values/styles.xmladd the below entries
<style name="TextStyle" parent="AppTheme">
<item name="android:text">@string/let_me_out</item>
</style>
<style name="ImageStyle" parent="AppTheme">
<item name="android:src">@drawable/airlock</item>
</style>- In the
res/values-night/styles.xmladd the below entries
<style name="TextStyle" parent="AppTheme">
<item name="android:text">@string/let_me_out</item>
</style>
<style name="ImageStyle" parent="AppTheme">
<item name="android:src">@drawable/astronaut</item>
</style>