Skip to content

Latest commit

 

History

History
85 lines (64 loc) · 2.05 KB

README.md

File metadata and controls

85 lines (64 loc) · 2.05 KB

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