dynamic android skin module for application
- support dynamic add view to skin.
- support skin attr extanded to use for most view.
- support customize resource parse when you want to do something.
- support cold start skin effective.
- force prevent fragment create skin view memory leak.
1.take skin resource in lib_skin_factory project , such as sample , pay attention resource name must same to target .
2.use gradle command "assembleDebug" or "assembleRelease" in lib_skin_factory project , the skin file will be create in path "/lib_skin_factory/skin_output/".
at now , skin module just provide libaray mode to import , lool like:
compile project(':lib_skin')
you must init skin module in your custom application
SkinManager.init(this);
you can load skin file in any where
SkinManager.getInstance().load();
// or
SkinManager.getInstance().load(SkinLoadCallback callback)
// or
SkinManager.getInstance().load(final String skinPath, final SkinLoadCallback callback);
clear already load skin file and take default skin effictive
SkinManager.getInstance().clearSkin();
1.library support extanded skin attr
SkinManager.getInstance().addSkinAttrType(String attrName, Class<? extends BaseAttr> cls);
2.library support customize resource parse
SkinManager.getInstance().setResourceParse(IResourceParse parse);
Do't need call skin load when application already load it at last runtime .
View Prase.(take a customize xml prase create view to find skin enable view)
LayoutInflaterCompat.setFactory(LayoutInflater inflater, LayoutInflaterFactory factory);
Resource Prase.(use reflection init a resource object to load assetmanager)
AssetManager assetManager = AssetManager.class.newInstance();
Method addAssetPath = assetManager.getClass().getMethod("addAssetPath", String.class);
Resources skinResource = new Resources(AssetManager assets, DisplayMetrics metrics, Configuration config);
- a. support maven center to import.
- b. optimization skin fackory library.
- c. add project mind map.