From 7ca648004bb8e9bce040984c9e39de743c8da152 Mon Sep 17 00:00:00 2001 From: Brian Pinsard Date: Tue, 17 Jan 2017 23:57:43 +0100 Subject: [PATCH] Reformat code --- .../java/com/simplemobiletools/draw/MyCanvas.java | 14 +++++++------- .../draw/activities/MainActivity.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java b/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java index 0d3a219..b643288 100644 --- a/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java +++ b/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java @@ -66,14 +66,14 @@ public class MyCanvas extends View { public void setColor(int newColor) { mPaintOptions.color = newColor; - if(mIsStrokeWidthBarEnabled) { + if (mIsStrokeWidthBarEnabled) { invalidate(); } } - public void setStrokeWidth(float newStrokeWidth){ + public void setStrokeWidth(float newStrokeWidth) { mPaintOptions.strokeWidth = newStrokeWidth; - if(mIsStrokeWidthBarEnabled) { + if (mIsStrokeWidthBarEnabled) { invalidate(); } } @@ -105,17 +105,17 @@ public class MyCanvas extends View { changePaint(mPaintOptions); canvas.drawPath(mPath, mPaint); - if(mIsStrokeWidthBarEnabled && !mIsSaving) { + if (mIsStrokeWidthBarEnabled && !mIsSaving) { drawPreviewDot(canvas); } } private void drawPreviewDot(Canvas canvas) { - mPaint.setColor(Utils.shouldUseWhite(mPaintOptions.color)?Color.WHITE:Color.BLACK); + mPaint.setColor(Utils.shouldUseWhite(mPaintOptions.color) ? Color.WHITE : Color.BLACK); mPaint.setStrokeWidth(mPaintOptions.strokeWidth + Constants.PREVIEW_DOT_STROKE_SIZE); - canvas.drawPoint(getWidth()/2, getHeight() - Constants.PREVIEW_DOT_OFFSET_Y, mPaint); + canvas.drawPoint(getWidth() / 2, getHeight() - Constants.PREVIEW_DOT_OFFSET_Y, mPaint); changePaint(mPaintOptions); - canvas.drawPoint(getWidth()/2, getHeight() - Constants.PREVIEW_DOT_OFFSET_Y, mPaint); + canvas.drawPoint(getWidth() / 2, getHeight() - Constants.PREVIEW_DOT_OFFSET_Y, mPaint); } private void changePaint(PaintOptions paintOptions) { diff --git a/app/src/main/java/com/simplemobiletools/draw/activities/MainActivity.java b/app/src/main/java/com/simplemobiletools/draw/activities/MainActivity.java index 71f8667..ca4069f 100644 --- a/app/src/main/java/com/simplemobiletools/draw/activities/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/draw/activities/MainActivity.java @@ -74,7 +74,7 @@ public class MainActivity extends SimpleActivity implements MyCanvas.PathsChange protected void onResume() { super.onResume(); boolean isStrokeWidthBarEnabled = mConfig.getIsStrokeWidthBarEnabled(); - mStrokeWidthBar.setVisibility(isStrokeWidthBarEnabled? View.VISIBLE:View.GONE); + mStrokeWidthBar.setVisibility(isStrokeWidthBarEnabled ? View.VISIBLE : View.GONE); mMyCanvas.setIsStrokeWidthBarEnabled(isStrokeWidthBarEnabled); }