// Path: AnKey/resource/src/main/java/net/qiujuer/powerback/ankey/widget/drawable/shape/CrossLineShape.java
// public class CrossLineShape extends Shape {
//     private float mCenterX, mCenterY;
//     private float mHalfLong;
// 
//     @Override
//     public void draw(Canvas canvas, Paint paint) {
//         float topY = mCenterY - mHalfLong;
//         float bottomY = mCenterY + mHalfLong;
// 
//         canvas.drawLine(mCenterX, topY, mCenterX, bottomY, paint);
// 
// 
//         float leftX = mCenterX - mHalfLong;
//         float rightX = mCenterX + mHalfLong;
// 
//         canvas.drawLine(leftX, mCenterY, rightX, mCenterY, paint);
//     }
// 
//     @Override
//     protected void onResize(float width, float height) {
//         mCenterX = width / 2;
//         mCenterY = height / 2;
// 
//         float minLong = Math.min(width, height);
//         mHalfLong = minLong * 0.2f;
//     }
// }
// 
// Path: AnKey/resource/src/main/java/net/qiujuer/powerback/ankey/widget/drawable/shape/OkLineShape.java
// public class OkLineShape extends Shape {
//     private PointF mStart = new PointF();
//     private PointF mCenter = new PointF();
//     private PointF mStop = new PointF();
// 
//     @Override
//     public void draw(Canvas canvas, Paint paint) {
//         canvas.drawLine(mStart.x, mStart.y, mCenter.x, mCenter.y, paint);
//         canvas.drawLine(mCenter.x, mCenter.y, mStop.x, mStop.y, paint);
//     }
// 
//     @Override
//     protected void onResize(float width, float height) {
//         float tw = width * 0.3f;
//         float th = height * 0.35f;
// 
//         mStart.set(tw, height * 0.5f);
//         mCenter.set(width * 0.46f, height - th);
//         mStop.set(width - tw, th * 0.9f);
//     }
// }
// 
// Path: AnKey/resource/src/main/java/net/qiujuer/powerback/ankey/widget/drawable/shape/ShadowShape.java
// public class ShadowShape extends Shape {
//     private int mColor;
//     private float mShadowLen;
// 
//     public ShadowShape(int color, float shadowLen) {
//         mColor = color;
//         mShadowLen = shadowLen;
//     }
// 
//     @Override
//     public void draw(Canvas canvas, Paint paint) {
//         float w = getWidth();
//         float h = getHeight() - 1;
// 
//         float sh = h - mShadowLen;
// 
//         // draw the background
//         int sc = canvas.save();
//         canvas.clipRect(0, 0, w, sh);
//         canvas.drawColor(mColor);
//         canvas.restoreToCount(sc);
// 
//         canvas.drawRect(0, sh, w, h, paint);
//     }
// }


import android.content.res.Resources;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.Shape;
import net.qiujuer.powerback.ankey.widget.drawable.shape.CrossLineShape;
import net.qiujuer.powerback.ankey.widget.drawable.shape.OkLineShape;
import net.qiujuer.powerback.ankey.widget.drawable.shape.ShadowShape;
package net.qiujuer.powerback.ankey.widget.drawable;



/**
 * Created by qiujuer
 * on 15/11/9.
 */
public class Drawables {
    private static ShapeDrawable createShapeDrawable(Resources resources, Shape shape, int color, int size, int lineSize) {
        final float density = resources.getDisplayMetrics().density;
        ShapeDrawable drawable = new ShapeDrawable(shape);
        Paint paint = drawable.getPaint();
        paint.setStyle(Paint.Style.STROKE);
        paint.setAntiAlias(true);
        paint.setDither(true);
        paint.setColor(color);
        paint.setStrokeWidth(lineSize * density);
        paint.setStrokeCap(Paint.Cap.ROUND);
        drawable.setIntrinsicWidth((int) (size * density));
        drawable.setIntrinsicHeight((int) (size * density));
        return drawable;
    }

    private static Rect convertDPToPX(Rect rect, float density) {
        if (rect != null) {
            rect.left *= density;
            rect.top *= density;
            rect.right *= density;
            rect.bottom *= density;
        }
        return rect;
    }

    public static Drawable getCreateDrawable(Resources resources) {
        Shape shape = new CrossLineShape();
        return createShapeDrawable(resources, shape, 0xfffbfbfb, 36, 2);
    }

    public static Drawable getOkDrawable(Resources resources) {
// Path: AnKey/resource/src/main/java/net/qiujuer/powerback/ankey/widget/drawable/shape/CrossLineShape.java
// public class CrossLineShape extends Shape {
//     private float mCenterX, mCenterY;
//     private float mHalfLong;
// 
//     @Override
//     public void draw(Canvas canvas, Paint paint) {
//         float topY = mCenterY - mHalfLong;
//         float bottomY = mCenterY + mHalfLong;
// 
//         canvas.drawLine(mCenterX, topY, mCenterX, bottomY, paint);
// 
// 
//         float leftX = mCenterX - mHalfLong;
//         float rightX = mCenterX + mHalfLong;
// 
//         canvas.drawLine(leftX, mCenterY, rightX, mCenterY, paint);
//     }
// 
//     @Override
//     protected void onResize(float width, float height) {
//         mCenterX = width / 2;
//         mCenterY = height / 2;
// 
//         float minLong = Math.min(width, height);
//         mHalfLong = minLong * 0.2f;
//     }
// }
// 
// Path: AnKey/resource/src/main/java/net/qiujuer/powerback/ankey/widget/drawable/shape/OkLineShape.java
// public class OkLineShape extends Shape {
//     private PointF mStart = new PointF();
//     private PointF mCenter = new PointF();
//     private PointF mStop = new PointF();
// 
//     @Override
//     public void draw(Canvas canvas, Paint paint) {
//         canvas.drawLine(mStart.x, mStart.y, mCenter.x, mCenter.y, paint);
//         canvas.drawLine(mCenter.x, mCenter.y, mStop.x, mStop.y, paint);
//     }
// 
//     @Override
//     protected void onResize(float width, float height) {
//         float tw = width * 0.3f;
//         float th = height * 0.35f;
// 
//         mStart.set(tw, height * 0.5f);
//         mCenter.set(width * 0.46f, height - th);
//         mStop.set(width - tw, th * 0.9f);
//     }
// }
// 
// Path: AnKey/resource/src/main/java/net/qiujuer/powerback/ankey/widget/drawable/shape/ShadowShape.java
// public class ShadowShape extends Shape {
//     private int mColor;
//     private float mShadowLen;
// 
//     public ShadowShape(int color, float shadowLen) {
//         mColor = color;
//         mShadowLen = shadowLen;
//     }
// 
//     @Override
//     public void draw(Canvas canvas, Paint paint) {
//         float w = getWidth();
//         float h = getHeight() - 1;
// 
//         float sh = h - mShadowLen;
// 
//         // draw the background
//         int sc = canvas.save();
//         canvas.clipRect(0, 0, w, sh);
//         canvas.drawColor(mColor);
//         canvas.restoreToCount(sc);
// 
//         canvas.drawRect(0, sh, w, h, paint);
//     }
// }


// Path: AnKey/resource/src/main/java/net/qiujuer/powerback/ankey/widget/drawable/Drawables.java
import android.content.res.Resources;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.Shape;
import net.qiujuer.powerback.ankey.widget.drawable.shape.CrossLineShape;
import net.qiujuer.powerback.ankey.widget.drawable.shape.OkLineShape;
import net.qiujuer.powerback.ankey.widget.drawable.shape.ShadowShape;

package net.qiujuer.powerback.ankey.widget.drawable;



/**
 * Created by qiujuer
 * on 15/11/9.
 */
public class Drawables {
    private static ShapeDrawable createShapeDrawable(Resources resources, Shape shape, int color, int size, int lineSize) {
        final float density = resources.getDisplayMetrics().density;
        ShapeDrawable drawable = new ShapeDrawable(shape);
        Paint paint = drawable.getPaint();
        paint.setStyle(Paint.Style.STROKE);
        paint.setAntiAlias(true);
        paint.setDither(true);
        paint.setColor(color);
        paint.setStrokeWidth(lineSize * density);
        paint.setStrokeCap(Paint.Cap.ROUND);
        drawable.setIntrinsicWidth((int) (size * density));
        drawable.setIntrinsicHeight((int) (size * density));
        return drawable;
    }

    private static Rect convertDPToPX(Rect rect, float density) {
        if (rect != null) {
            rect.left *= density;
            rect.top *= density;
            rect.right *= density;
            rect.bottom *= density;
        }
        return rect;
    }

    public static Drawable getCreateDrawable(Resources resources) {
        Shape shape = new CrossLineShape();
        return createShapeDrawable(resources, shape, 0xfffbfbfb, 36, 2);
    }

    public static Drawable getOkDrawable(Resources resources) {
        Shape shape = new OkLineShape();