question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change Theme at runtime

See original GitHub issue

Problem: 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:open
  • Created 5 years ago
  • Reactions:11
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
oliveryasunacommented, Jan 24, 2021

This would be a great feature. Even if a refresh is necessary, you should be able to change the theme at runtime.

0reactions
probert94commented, Apr 16, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found