2
votes

Need to download and apply styles, image buttons and someone else in runtime of app. Is such the function in Codename One? In the what format I need to download them?

1

1 Answers

3
votes

You can dynamically download a res file created by the designer and install it in runtime using:

Resources res = Resources.open(...);
UIManager.getInstance().setThemeProps(res.getTheme(themes[0]));

You can dynamically refresh the current UI with the new theme by using:

currentForm.refreshTheme();

See the kitchen sinks theme demo, although the themes aren't dynamically downloaded there the concepts should be easily understandable.