// Path: baselibrary/src/main/java/com/dim/skin/SkinStyle.java
// public enum SkinStyle {
// 
//     Dark,
//     Light//默认Light
// }
// 
// Path: baselibrary/src/main/java/com/dim/widget/SLayoutParamsI.java
// public interface SLayoutParamsI {
// 
//      void setSkinStyle(SkinStyle skinStyle);
// }
// 
// Path: baselibrary/src/main/java/com/dim/skin/SkinConfig.java
// public class SkinConfig {
// 
//     public static SkinStyle getSkinStyle(Context context) {
//         SharedPreferences sharedPreferences = context.getSharedPreferences("SkinStyle",
//                 Activity.MODE_PRIVATE);
//         boolean nightMode = sharedPreferences.getBoolean("nightMode", false);
//         return nightMode ? SkinStyle.Dark : SkinStyle.Light;
//     }
// 
//     public static void setSkinStyle(Context context, SkinStyle skinStyle) {
//         SharedPreferences.Editor editor = context.getSharedPreferences("SkinStyle",
//                 Activity.MODE_PRIVATE).edit();
//         editor.putBoolean("nightMode", skinStyle == SkinStyle.Dark).apply();
//     }
// 
// }
// 
// Path: baselibrary/src/main/java/com/dim/skin/SkinEnable.java
// public interface SkinEnable {
// 
//     void setSkinStyle(SkinStyle skinStyle);
// }


import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import com.dim.skin.SkinStyle;
import com.dim.widget.SLayoutParamsI;
import com.dim.skin.SkinConfig;
import com.dim.skin.SkinEnable;
            skinStyleChangeListener.beforeChange();
        changeSkinStyle(v, SkinConfig.getSkinStyle(v.getContext()));
        if (skinStyleChangeListener != null)
            skinStyleChangeListener.afterChange();


    }

    public static void setCurrentTheme(Activity activity, SkinStyleChangeListener skinStyleChangeListener) {
        if (skinStyleChangeListener != null)
            skinStyleChangeListener.beforeChange();
        setSkinStyle(activity, SkinConfig.getSkinStyle(activity), null);
        if (skinStyleChangeListener != null)
            skinStyleChangeListener.afterChange();
    }


    public static void changeSkinStyle(View view, SkinStyle skinStyle) {

        changeSkinView(view, skinStyle);

        if (view instanceof ViewGroup) {
            for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
                View v = ((ViewGroup) view).getChildAt(i);
                changeSkinStyle(v, skinStyle);
            }
        }
    }

    public static void changeSkinView(View view, SkinStyle skinStyle) {
// Path: baselibrary/src/main/java/com/dim/skin/SkinStyle.java
// public enum SkinStyle {
// 
//     Dark,
//     Light//默认Light
// }
// 
// Path: baselibrary/src/main/java/com/dim/widget/SLayoutParamsI.java
// public interface SLayoutParamsI {
// 
//      void setSkinStyle(SkinStyle skinStyle);
// }
// 
// Path: baselibrary/src/main/java/com/dim/skin/SkinConfig.java
// public class SkinConfig {
// 
//     public static SkinStyle getSkinStyle(Context context) {
//         SharedPreferences sharedPreferences = context.getSharedPreferences("SkinStyle",
//                 Activity.MODE_PRIVATE);
//         boolean nightMode = sharedPreferences.getBoolean("nightMode", false);
//         return nightMode ? SkinStyle.Dark : SkinStyle.Light;
//     }
// 
//     public static void setSkinStyle(Context context, SkinStyle skinStyle) {
//         SharedPreferences.Editor editor = context.getSharedPreferences("SkinStyle",
//                 Activity.MODE_PRIVATE).edit();
//         editor.putBoolean("nightMode", skinStyle == SkinStyle.Dark).apply();
//     }
// 
// }
// 
// Path: baselibrary/src/main/java/com/dim/skin/SkinEnable.java
// public interface SkinEnable {
// 
//     void setSkinStyle(SkinStyle skinStyle);
// }


// Path: baselibrary/src/main/java/com/dim/skin/hepler/SkinCompat.java
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import com.dim.skin.SkinStyle;
import com.dim.widget.SLayoutParamsI;
import com.dim.skin.SkinConfig;
import com.dim.skin.SkinEnable;

            skinStyleChangeListener.beforeChange();
        changeSkinStyle(v, SkinConfig.getSkinStyle(v.getContext()));
        if (skinStyleChangeListener != null)
            skinStyleChangeListener.afterChange();


    }

    public static void setCurrentTheme(Activity activity, SkinStyleChangeListener skinStyleChangeListener) {
        if (skinStyleChangeListener != null)
            skinStyleChangeListener.beforeChange();
        setSkinStyle(activity, SkinConfig.getSkinStyle(activity), null);
        if (skinStyleChangeListener != null)
            skinStyleChangeListener.afterChange();
    }


    public static void changeSkinStyle(View view, SkinStyle skinStyle) {

        changeSkinView(view, skinStyle);

        if (view instanceof ViewGroup) {
            for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
                View v = ((ViewGroup) view).getChildAt(i);
                changeSkinStyle(v, skinStyle);
            }
        }
    }

    public static void changeSkinView(View view, SkinStyle skinStyle) {
        if (view instanceof SkinEnable) {