// Path: skin-support/src/main/java/skin/support/widget/SkinCompatBackgroundHelper.java
// public class SkinCompatBackgroundHelper extends SkinCompatHelper {
//     private final View mView;
// 
//     private int mBackgroundResId = INVALID_ID;
// 
//     public SkinCompatBackgroundHelper(View view) {
//         mView = view;
//     }
// 
//     public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
//         TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), attrs,
//                 R.styleable.SkinBackgroundHelper, defStyleAttr, 0);
//         try {
//             if (a.hasValue(R.styleable.SkinBackgroundHelper_android_background)) {
//                 mBackgroundResId = a.getResourceId(
//                         R.styleable.SkinBackgroundHelper_android_background, INVALID_ID);
//             }
//         } finally {
//             a.recycle();
//         }
//         applySkin();
//     }
// 
//     public void onSetBackgroundResource(int resId) {
//         mBackgroundResId = resId;
//         // Update the default background tint
//         applySkin();
//     }
// 
//     public void applySkin() {
//         mBackgroundResId = checkResourceId(mBackgroundResId);
//         if (mBackgroundResId == INVALID_ID) {
//             return;
//         }
//         String typeName = mView.getResources().getResourceTypeName(mBackgroundResId);
//         if ("color".equals(typeName)) {
//             if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
//                 int color = SkinCompatResources.getInstance().getColor(mBackgroundResId);
//                 mView.setBackgroundColor(color);
//             } else {
//                 ColorStateList colorStateList = SkinCompatResources.getInstance().getColorStateList(mBackgroundResId);
//                 Drawable drawable = mView.getBackground();
//                 DrawableCompat.setTintList(drawable, colorStateList);
//                 ViewCompat.setBackground(mView, drawable);
//             }
//         } else if ("drawable".equals(typeName)) {
//             Drawable drawable = SkinCompatResources.getInstance().getDrawable(mBackgroundResId);
//             ViewCompat.setBackground(mView, drawable);
//         } else if ("mipmap".equals(typeName)) {
//             Drawable drawable = SkinCompatResources.getInstance().getMipmap(mBackgroundResId);
//             ViewCompat.setBackground(mView, drawable);
//         }
//     }
// }
// 
// Path: skin-support/src/main/java/skin/support/widget/SkinCompatSupportable.java
// public interface SkinCompatSupportable {
//     void applySkin();
// }


import android.content.Context;
import android.support.design.widget.AppBarLayout;
import android.util.AttributeSet;
import skin.support.widget.SkinCompatBackgroundHelper;
import skin.support.widget.SkinCompatSupportable;
package skin.support.design.widget;



/**
 * Created by ximsfei on 2017/1/13.
 */

public class SkinCompatAppBarLayout extends AppBarLayout implements SkinCompatSupportable {
    private final SkinCompatBackgroundHelper mBackgroundTintHelper;

    public SkinCompatAppBarLayout(Context context) {
        this(context, null);
    }

    public SkinCompatAppBarLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
// Path: skin-support/src/main/java/skin/support/widget/SkinCompatBackgroundHelper.java
// public class SkinCompatBackgroundHelper extends SkinCompatHelper {
//     private final View mView;
// 
//     private int mBackgroundResId = INVALID_ID;
// 
//     public SkinCompatBackgroundHelper(View view) {
//         mView = view;
//     }
// 
//     public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
//         TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), attrs,
//                 R.styleable.SkinBackgroundHelper, defStyleAttr, 0);
//         try {
//             if (a.hasValue(R.styleable.SkinBackgroundHelper_android_background)) {
//                 mBackgroundResId = a.getResourceId(
//                         R.styleable.SkinBackgroundHelper_android_background, INVALID_ID);
//             }
//         } finally {
//             a.recycle();
//         }
//         applySkin();
//     }
// 
//     public void onSetBackgroundResource(int resId) {
//         mBackgroundResId = resId;
//         // Update the default background tint
//         applySkin();
//     }
// 
//     public void applySkin() {
//         mBackgroundResId = checkResourceId(mBackgroundResId);
//         if (mBackgroundResId == INVALID_ID) {
//             return;
//         }
//         String typeName = mView.getResources().getResourceTypeName(mBackgroundResId);
//         if ("color".equals(typeName)) {
//             if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
//                 int color = SkinCompatResources.getInstance().getColor(mBackgroundResId);
//                 mView.setBackgroundColor(color);
//             } else {
//                 ColorStateList colorStateList = SkinCompatResources.getInstance().getColorStateList(mBackgroundResId);
//                 Drawable drawable = mView.getBackground();
//                 DrawableCompat.setTintList(drawable, colorStateList);
//                 ViewCompat.setBackground(mView, drawable);
//             }
//         } else if ("drawable".equals(typeName)) {
//             Drawable drawable = SkinCompatResources.getInstance().getDrawable(mBackgroundResId);
//             ViewCompat.setBackground(mView, drawable);
//         } else if ("mipmap".equals(typeName)) {
//             Drawable drawable = SkinCompatResources.getInstance().getMipmap(mBackgroundResId);
//             ViewCompat.setBackground(mView, drawable);
//         }
//     }
// }
// 
// Path: skin-support/src/main/java/skin/support/widget/SkinCompatSupportable.java
// public interface SkinCompatSupportable {
//     void applySkin();
// }


// Path: skin-support-design/src/main/java/skin/support/design/widget/SkinCompatAppBarLayout.java
import android.content.Context;
import android.support.design.widget.AppBarLayout;
import android.util.AttributeSet;
import skin.support.widget.SkinCompatBackgroundHelper;
import skin.support.widget.SkinCompatSupportable;

package skin.support.design.widget;



/**
 * Created by ximsfei on 2017/1/13.
 */

public class SkinCompatAppBarLayout extends AppBarLayout implements SkinCompatSupportable {
    private final SkinCompatBackgroundHelper mBackgroundTintHelper;

    public SkinCompatAppBarLayout(Context context) {
        this(context, null);
    }

    public SkinCompatAppBarLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);