Contact me : [email protected]
A skin manager load skin from local file dynamically.
Now support background , text color , list divider and list selector
-
Init skin loader in
Application
public class SkinApplication extends Application { public void onCreate() { super.onCreate(); // Must call init first SkinManager.getInstance().init(this); SkinManager.getInstance().load(); } } ```
-
tag the view that need to change skin in layout xml files
... xmlns:skin="http://schemas.android.com/android/skin" ... <TextView ... skin:enable="true" ... />
-
Extend Acticity from
SkinPluginActivity
-
Set a custom skin from
.skin
file
String SKIN_NAME = "BlackFantacy.skin"; String SKIN_DIR = Environment.getExternalStorageDirectory() + File.separator + SKIN_NAME; File skin = new File(SKIN_DIR); SkinManager.getInstance().load(skin.getAbsolutePath(), new ILoaderListener() { @Override public void onStart() { }
@Override
public void onSuccess() {
}
@Override
public void onFailed() {
}
});
```
-
Restore to default skin
SkinManager.getInstance().restoreDefaultTheme();