// 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;
        return createShapeDrawable(resources, shape, 0xfffbfbfb, 36, 2);
    }

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

    public static Drawable getDirectDrawable(Resources resources, int angle, int direct, Rect padding) {
        final float density = resources.getDisplayMetrics().density;
        DirectArrowDrawable directArrowDrawable = new DirectArrowDrawable(angle, direct, density * 2, 0xfffbfbfb);
        directArrowDrawable.setPadding(convertDPToPX(padding, density));
        return directArrowDrawable;
    }

    public static Drawable getShadowDrawable(Resources resources, int color) {
        return getShadowDrawable(resources, color, 0x80000000, 4);
    }

    public static Drawable getShadowDrawable(Resources resources, int color, int sColor, int sLen) {
        final float density = resources.getDisplayMetrics().density;
        float sLenPx = sLen * density;

        ShadowShape shape = new ShadowShape(color, sLenPx);
        ShapeDrawable drawable = new ShapeDrawable(shape);

        Paint paint = drawable.getPaint();
        paint.setStyle(Paint.Style.FILL);
        paint.setAntiAlias(true);
        paint.setDither(true);
// 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;

        return createShapeDrawable(resources, shape, 0xfffbfbfb, 36, 2);
    }

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

    public static Drawable getDirectDrawable(Resources resources, int angle, int direct, Rect padding) {
        final float density = resources.getDisplayMetrics().density;
        DirectArrowDrawable directArrowDrawable = new DirectArrowDrawable(angle, direct, density * 2, 0xfffbfbfb);
        directArrowDrawable.setPadding(convertDPToPX(padding, density));
        return directArrowDrawable;
    }

    public static Drawable getShadowDrawable(Resources resources, int color) {
        return getShadowDrawable(resources, color, 0x80000000, 4);
    }

    public static Drawable getShadowDrawable(Resources resources, int color, int sColor, int sLen) {
        final float density = resources.getDisplayMetrics().density;
        float sLenPx = sLen * density;

        ShadowShape shape = new ShadowShape(color, sLenPx);
        ShapeDrawable drawable = new ShapeDrawable(shape);

        Paint paint = drawable.getPaint();
        paint.setStyle(Paint.Style.FILL);
        paint.setAntiAlias(true);
        paint.setDither(true);
        paint.setColor(sColor);