|
|
@ -25,14 +25,18 @@ public class CustomBorderDrawable extends ShapeDrawable {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
|
|
|
|
protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
|
|
|
|
shape.resize(canvas.getWidth(), canvas.getHeight());
|
|
|
|
shape.resize(canvas.getClipBounds().right,
|
|
|
|
shape.draw(canvas, fillpaint);
|
|
|
|
canvas.getClipBounds().bottom);
|
|
|
|
|
|
|
|
|
|
|
|
Matrix matrix = new Matrix();
|
|
|
|
Matrix matrix = new Matrix();
|
|
|
|
matrix.setRectToRect(new RectF(0, 0, canvas.getWidth(), canvas.getHeight()),
|
|
|
|
matrix.setRectToRect(new RectF(0, 0, canvas.getClipBounds().right,
|
|
|
|
new RectF(strokeWidth/2, strokeWidth/2, canvas.getWidth() - strokeWidth/2, canvas.getHeight() - strokeWidth/2),
|
|
|
|
canvas.getClipBounds().bottom),
|
|
|
|
|
|
|
|
new RectF(strokeWidth/2, strokeWidth/2, canvas.getClipBounds().right - strokeWidth/2,
|
|
|
|
|
|
|
|
canvas.getClipBounds().bottom - strokeWidth/2),
|
|
|
|
Matrix.ScaleToFit.FILL);
|
|
|
|
Matrix.ScaleToFit.FILL);
|
|
|
|
canvas.concat(matrix);
|
|
|
|
canvas.concat(matrix);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shape.draw(canvas, fillpaint);
|
|
|
|
shape.draw(canvas, strokepaint);
|
|
|
|
shape.draw(canvas, strokepaint);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|