You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
Rey Pham edited this page Sep 13, 2015
·
1 revision
ThemeManager
All widgets in com.rey.material package have applyStyle(int) method so you can change the style dynamically at runtime. But to support dynamic theme, you still have to do a lot of works, like save and restore current theme, and apply new style to all widgets when theme is changed. And that is what ThemeManager will do for you.
Usage
First, you have to initialize ThemeManager via init(Context context, int totalTheme, int defaultTheme, @Nullable EventDispatcher dispatcher) method. It should be done in onCreate() method of Application. For example:
Note that you can use both style and v_styleId attribute to style the widget, but the style of v_styleId attribute will override the style of style attribute.
It's done. We can change the theme of app simply by calling setCurrentTheme(int) method.