Skip to content

Commit

Permalink
Some linting in BorderFab
Browse files Browse the repository at this point in the history
  • Loading branch information
TacoTheDank committed Mar 29, 2021
1 parent 882a5d0 commit c95bf51
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/src/main/java/com/benny/pxerstudio/widget/BorderFab.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class BorderFab extends FloatingActionButton {
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
Paint colorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
float three, one;
Path path = new Path();
Rect rect = new Rect(0, 0, getWidth(), getHeight());

Bitmap bg;

Expand Down Expand Up @@ -66,14 +68,13 @@ protected void onDraw(Canvas canvas) {
colorPaint.setColor(Color.WHITE);

canvas.save();
Path p = new Path();
p.addCircle(getWidth() / 2, getHeight() / 2, getWidth() / 3 + one, Path.Direction.CCW);
canvas.clipPath(p);
canvas.drawBitmap(bg, null, new Rect(0, 0, getWidth(), getHeight()), colorPaint);
path.addCircle(getWidth() / 2f, getHeight() / 2f, getWidth() / 3f + one, Path.Direction.CCW);
canvas.clipPath(path);
canvas.drawBitmap(bg, null, rect, colorPaint);
canvas.restore();

colorPaint.setColor(color);
canvas.drawCircle(getWidth() / 2, getHeight() / 2, getWidth() / 3 + one, colorPaint);
canvas.drawCircle(getWidth() / 2, getHeight() / 2, getWidth() / 3 + one, paint);
canvas.drawCircle(getWidth() / 2f, getHeight() / 2f, getWidth() / 3f + one, colorPaint);
canvas.drawCircle(getWidth() / 2f, getHeight() / 2f, getWidth() / 3f + one, paint);
}
}

0 comments on commit c95bf51

Please sign in to comment.