Introduction: Android-skin-support: 一款用心去做的 Android 换肤框架, 极低的学习成本, 极好的用户体验. 只需要两行代码, 就可以实现换肤, 你值得拥有!!!
More: Author   ReportBugs   

In English | 中文

skin-support build license

Android-skin-support is an easy to use skin framework for Android. The best case, Only one line of code to integrate the framework.


Now, you have a strong skinning feature. What you need to do is make a skin.

default app-in plug-in

Table of Contents

Gradle Dependencies

The Gradle Dependency is available via jCenter,

Add dependencies directly, For the latest version, please refer to change log

compile ''                   // skin-support basic widget
compile ''            // skin-support-design material design support [selectable]
compile ''          // skin-support-cardview CardView support [selectable]
compile '' // skin-support-constraint-layout ConstraintLayout support [selectable]



Only one line of code to integrate the framework.

public void onCreate() {
    SkinCompatManager.withoutActivity(this)                         // Basic Widget support
            .addInflater(new SkinMaterialViewInflater())            // material design support           [selectable]
            .addInflater(new SkinConstraintViewInflater())          // ConstraintLayout support          [selectable]
            .addInflater(new SkinCardViewInflater())                // CardView v7 support               [selectable]
            .setSkinStatusBarColorEnable(false)                     // Disable statusBarColor skin support,default true   [selectable]
            .setSkinWindowBackgroundEnable(false)                   // Disable windowBackground skin support,default true [selectable]

Load Skin

// Load the specified skin
SkinCompatManager.getInstance().loadSkin(""[, SkinLoaderListener], int strategy);

// restore default skin

Custom View skin support

  1. Implement the SkinCompatSupportable interface

    1. Apply skin resource in the applySkin method
  2. Resolve the skin resource id in the constructor

  3. Custom View can inherit directly from existing widget, such as SkinCompatView, SkinCompatLinearLayout, etc.

    eg: CustomTextView

  4. if you don't want to inherit from existing widget.

    eg: CustomTextView2

  5. If you need to skin the custom attributes.

    // such as AutoCompleteTextView's R.attr.popupBackground attribute

    eg: SkinCompatAutoCompleteTextView

  6. If you need to use third-party library.

    // need to use widget

    eg: SkinCompatCircleImageView

Make a skin

BuildIn Skin:

BuildIn Skin,if the skin name is night; Add a resource that needs to be skinned with a suffix _night or prefix night_.

if the default resource is R.color.windowBackgroundColor, then you can add a resource R.color.windowBackgroundColor_night

load buildIn skin:

SkinCompatManager.getInstance().loadSkin("night", SkinCompatManager.SKIN_LOADER_STRATEGY_BUILD_IN); // load by suffix
SkinCompatManager.getInstance().loadSkin("night", SkinCompatManager.SKIN_LOADER_STRATEGY_PREFIX_BUILD_IN); // load by prefix

Plug-in Skin:

New Android Application Project

Put the skin resources into the res directory

If the original window background is


<color name="background">#ffffff</color>

for night-mode you can add this in the skin-night project


<color name="background">#000000</color>

Generated apk is the skin package

You can rename night.apk to by yourself.

Load plug-in skin package

You can put the skin package into the assets/skins directory.

SkinCompatManager.getInstance().loadSkin("", SkinCompatManager.SKIN_LOADER_STRATEGY_ASSETS);

Or you can customize the loading strategy:

For example:

Inherit from SkinSDCardLoader,Override the getSkinPathgetType methods。

public class CustomSDCardLoader extends SkinSDCardLoader {
    public static final int SKIN_LOADER_STRATEGY_SDCARD = Integer.MAX_VALUE;

    protected String getSkinPath(Context context, String skinName) {
        return new File(SkinFileUtils.getSkinDir(context), skinName).getAbsolutePath();

    public int getType() {

Register this strategy in Application's onCreate

SkinCompatManager.withoutActivity(this).addStrategy(new CustomSDCardLoader());

Use this strategy to load skin:

SkinCompatManager.getInstance().loadSkin("", null, CustomSDCardLoader.SKIN_LOADER_STRATEGY_SDCARD);

Who use it

icon name description
sohu newsclient lite
voice note
qoo app

About Author

Pengfeng Wang(王鹏锋)


License MIT

Support Me
About Me
Google+: Trinea trinea
GitHub: Trinea