Change Theme at runtime
See original GitHub issueProblem:
The theme is currently set using the @Theme
-annotation and it does not seem to be possible to change it at runtime.
Example use case:
If you create a webshop, which could be used by many different clients, you probably want to match their Corporate Identity / Corporate Design.
One company might prefer the Lumo-Theme while others might prefer the Material-Theme.
One might even have custom Theme
-Classes.
At the moment, you have to build one version (.jar /.war) for every theme.
In my opinion, it would be better to have a way to configure this behavior at runtime.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:15 (4 by maintainers)
Top Results From Across the Web
How to change current Theme at runtime in Android
If you want to change theme of an already existing activity, call recreate() after setTheme() ...
Read more >How do I change current theme at runtime in my android ...
This example demonstrates how do I change current theme at runtime in my android app. Step 1 − Create a new project in...
Read more >Switching Themes at Runtime - Telerik UI for WPF
This article demonstrates how to switch the themes at runtime while using the implicit styling mechanism.
Read more >Implementing Dynamic Theming in Android | by Nihit Bansal
switchTheme(): This method will be used to switch between the two themes and also to store the new value of the theme in...
Read more >Change Theme of Layout Runtime by Button Click in Android
Create an Android project and name it "ChangeTheme" and then right-click on the project. Select "New -> Android XML File". This will open...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This would be a great feature. Even if a refresh is necessary, you should be able to change the theme at runtime.
I just wanted to let you know, that my solution/workaround doesn’t work since Vaadin 14.
This seems to make sense, since the frontend files are now bundled and the bundle will probably only contain the code for one theme.