Skip to content

一个通过动态加载本地皮肤包进行换肤的皮肤框架

License

Notifications You must be signed in to change notification settings

RUIZHENGGANG/Android-Skin-Loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android-Skin-Loader

Contact me : [email protected]

A skin manager load skin from local file dynamically.
Now support background , text color , list divider and list selector

Usage

  1. 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(); } } ```

  1. tag the view that need to change skin in layout xml files

    ...
    xmlns:skin="http://schemas.android.com/android/skin"
    ...
    
    <TextView
        ...
        skin:enable="true" 
        ... />
  2. Extend Acticity from SkinPluginActivity

  3. 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() {
				}
			});
```
  1. Restore to default skin

    SkinManager.getInstance().restoreDefaultTheme();

Sample screenshot

  • screenshot-1 sample-1

  • screenshot-2 sample-2

  • screenshot-3 sample-3

  • screenshot-4 sample-4

  • screenshot-5 sample-5

  • screenshot-6 sample-5

About

一个通过动态加载本地皮肤包进行换肤的皮肤框架

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%