How best to implement 2 UIs: light-theme and dark-theme?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-06 4:58 AM
Hello,
We have a final design for our UI, with all of the elements and widgets decided.
We would like to be able to make the color of the Application light-themed and dark-themed (similar to how in a source code editor, you can have a light-theme and dark-theme).
We would like to be able to change the theme during run-time, so that the customer can select which color option is best for them.
Is there a built-in way of doing this? The only ideas we have is either:
1) Deciding in the constructor of each Screen View, which color the Texts, Widgets, etc shall be, as well as which background images to load.
2) Creating a light-themed screen and a dark-themed screen for everything (which makes maintenance awfully tedious and difficult.
Solved! Go to Solution.
- Labels:
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-07 7:00 PM
Hello,
You save the value of your variable (e.g. light-theme = 0 and dark-theme = 1) in the Model and then in every setupScreen() function you check the value and set all your widgets on the selected screen accordingly.
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-07 7:00 PM
Hello,
You save the value of your variable (e.g. light-theme = 0 and dark-theme = 1) in the Model and then in every setupScreen() function you check the value and set all your widgets on the selected screen accordingly.
/Alexandre
