// Path: phial-overlay/src/main/java/com/mindcoders/phial/internal/util/support/ContextCompat.java
// public final class ContextCompat {
//     private ContextCompat() {
//         //to hide
//     }
// 
//     @SuppressWarnings("deprecation")
//     public static Drawable getDrawable(Context context, @DrawableRes int id) {
//         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//             return context.getDrawable(id);
//         }
// 
//         return context.getResources().getDrawable(id);
//     }
// }


import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.util.AttributeSet;
import android.view.View;
import com.mindcoders.phial.R;
import com.mindcoders.phial.internal.util.support.ContextCompat;

        if (!isInEditMode()) {
            setLayerType(LAYER_TYPE_SOFTWARE, bgPaint);
        }
        setupColors();
    }

    public void setIcon(Drawable drawable) {
        if (drawable != null) {
            icon = drawable.mutate();
        } else {
            icon = null;
        }
        refreshDrawableState();
        invalidate();
    }

    public void setIcon(Bitmap bitmap) {
        if (bitmap != null) {
            setIcon(new BitmapDrawable(getResources(), bitmap));
        } else {
            setIcon((Drawable) null);
        }
    }

    public Drawable getIcon() {
        return icon;
    }

    public void setIcon(@DrawableRes int iconId) {
// Path: phial-overlay/src/main/java/com/mindcoders/phial/internal/util/support/ContextCompat.java
// public final class ContextCompat {
//     private ContextCompat() {
//         //to hide
//     }
// 
//     @SuppressWarnings("deprecation")
//     public static Drawable getDrawable(Context context, @DrawableRes int id) {
//         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//             return context.getDrawable(id);
//         }
// 
//         return context.getResources().getDrawable(id);
//     }
// }


// Path: phial-overlay/src/main/java/com/mindcoders/phial/internal/overlay/PhialButton.java
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.util.AttributeSet;
import android.view.View;
import com.mindcoders.phial.R;
import com.mindcoders.phial.internal.util.support.ContextCompat;


        if (!isInEditMode()) {
            setLayerType(LAYER_TYPE_SOFTWARE, bgPaint);
        }
        setupColors();
    }

    public void setIcon(Drawable drawable) {
        if (drawable != null) {
            icon = drawable.mutate();
        } else {
            icon = null;
        }
        refreshDrawableState();
        invalidate();
    }

    public void setIcon(Bitmap bitmap) {
        if (bitmap != null) {
            setIcon(new BitmapDrawable(getResources(), bitmap));
        } else {
            setIcon((Drawable) null);
        }
    }

    public Drawable getIcon() {
        return icon;
    }

    public void setIcon(@DrawableRes int iconId) {
        setIcon(ContextCompat.getDrawable(getContext(), iconId));