diff --git a/app/src/main/java/com/simplemobiletools/draw/Constants.java b/app/src/main/java/com/simplemobiletools/draw/Constants.java index fd6e4e4..6e3696c 100644 --- a/app/src/main/java/com/simplemobiletools/draw/Constants.java +++ b/app/src/main/java/com/simplemobiletools/draw/Constants.java @@ -9,7 +9,4 @@ public class Constants { public static final String IS_FIRST_RUN = "is_first_run"; public static final String IS_DARK_THEME = "is_dark_theme"; public static final String IS_STROKE_WIDTH_BAR_ENABLED = "is_stroke_width_bar_enabled"; - // canvas - public static final int PREVIEW_DOT_STROKE_SIZE = 5; - public static final int PREVIEW_DOT_OFFSET_Y = 120; } diff --git a/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java b/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java index b643288..4b1f2bc 100644 --- a/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java +++ b/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java @@ -1,6 +1,7 @@ package com.simplemobiletools.draw; import android.content.Context; +import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; @@ -111,11 +112,12 @@ public class MyCanvas extends View { } private void drawPreviewDot(Canvas canvas) { + Resources res = getResources(); 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); + mPaint.setStrokeWidth(mPaintOptions.strokeWidth + res.getDimension(R.dimen.preview_dot_stroke_size)); + canvas.drawPoint(getWidth() / 2, getHeight() - res.getDimension(R.dimen.preview_dot_offset_y), mPaint); changePaint(mPaintOptions); - canvas.drawPoint(getWidth() / 2, getHeight() - Constants.PREVIEW_DOT_OFFSET_Y, mPaint); + canvas.drawPoint(getWidth() / 2, getHeight() - res.getDimension(R.dimen.preview_dot_offset_y), mPaint); } private void changePaint(PaintOptions paintOptions) { diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index fcef010..c48feeb 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -6,6 +6,8 @@ 40dp 8dp 150dp + 2dp + 50dp 14sp