@SuppressWarnings("SuspiciousNameCombination")
    @Override
    public void draw(Canvas canvas, Paint paint) {
        if (mBorder == null)
            return;

        float width = getWidth();
        float height = getHeight();

        if (mPathEffect == null) {

            // left
            if (mBorder.left > 0)
                canvas.drawRect(0, 0, mBorder.left, height, paint);

            // top
            if (mBorder.top > 0)
                canvas.drawRect(0, 0, width, mBorder.top, paint);

            // right
            if (mBorder.right > 0)
                canvas.drawRect(width - mBorder.right, 0, width, height, paint);

            // bottom
            if (mBorder.bottom > 0)
                canvas.drawRect(0, height - mBorder.bottom, width, height, paint);

        } else {
            if (paint.getPathEffect() != mPathEffect) {
                paint.setStyle(Paint.Style.STROKE);
                paint.setPathEffect(mPathEffect);
            }

            // left
            if (mBorder.left > 0) {
                paint.setStrokeWidth(mBorder.left);
                initPath(mBorder.left / 2, 0, mBorder.left / 2, height);
                canvas.drawPath(mPath, paint);
            }

            // top
            if (mBorder.top > 0) {
                paint.setStrokeWidth(mBorder.top);
                initPath(0, mBorder.top / 2, width, mBorder.top / 2);
                canvas.drawPath(mPath, paint);
            }

            // right
            if (mBorder.right > 0) {
                paint.setStrokeWidth(mBorder.right);
                initPath(width - mBorder.right / 2, 0, width - mBorder.right / 2, height);
                canvas.drawPath(mPath, paint);
            }

            // bottom
            if (mBorder.bottom > 0) {
                paint.setStrokeWidth(mBorder.bottom);
                initPath(0, height - mBorder.bottom / 2, width, height - mBorder.bottom / 2);
                canvas.drawPath(mPath, paint);
            }
        }
    }
This class is draw line on border
Line is support dash line
This class is extend shape
Use to ShapeDrawable class
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/shape/BorderShape.java