Replies: 3 comments 2 replies
-
Override |
Beta Was this translation helpful? Give feedback.
-
I'm using xml, not Compose, my app uses dynamic colours feature and dark
mode. I don't know how to change this 2 colours fun code..
пт, 25 нояб. 2022 г., 13:06 junkfood ***@***.***>:
… Override surface and background to black in your dark theme should work
—
Reply to this email directly, view it on GitHub
<#364 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANHJE5ACZ7KR5LVBQOIHND3WKCFSXANCNFSM6AAAAAASLA7VAU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@yurua Hi, you have to add to your themes.xml some items. You can choose whatever you want to use. This is the code you have to add: <style name="<Your app theme name>" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:colorBackground">@color/high_contrast_background</item>
<item name="android:colorForeground">@color/high_contrast_foreground</item>
<item name="android:colorPrimary">@color/high_contrast_primary</item>
<item name="android:colorPrimaryDark">@color/high_contrast_primary_dark</item>
<item name="android:colorAccent">@color/high_contrast_accent</item>
</style> And you also have to add these items to the colors.xml <color name="high_contrast_background">#FF000000</color>
<color name="high_contrast_foreground">#FFFFFFFF</color>
<color name="high_contrast_primary">#FF000000</color>
<color name="high_contrast_primary_dark">#FF000000</color>
<color name="high_contrast_accent">#FF000000</color> For example, if you just want to change the background color, you will only need to add the android:colorBackground to the themes.xml You're free to use the ones that you want. If you have another question leave it here! |
Beta Was this translation helpful? Give feedback.
-
How can I make High Contrast Mode in XML, not Compose?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions