Dynamic preview dot background + offset numbers converted to constants
This commit is contained in:
parent
ab28e2d2c7
commit
5d2c2560fa
|
@ -9,4 +9,7 @@ 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;
|
||||
}
|
||||
|
|
|
@ -112,10 +112,10 @@ public class MyCanvas extends View {
|
|||
|
||||
private void drawPreviewDot(Canvas canvas) {
|
||||
mPaint.setColor(Utils.shouldUseWhite(mPaintOptions.color)?Color.WHITE:Color.BLACK);
|
||||
mPaint.setStrokeWidth(100);
|
||||
canvas.drawPoint(getWidth()/2, getHeight() - 120, mPaint);
|
||||
mPaint.setStrokeWidth(mPaintOptions.strokeWidth + Constants.PREVIEW_DOT_STROKE_SIZE);
|
||||
canvas.drawPoint(getWidth()/2, getHeight() - Constants.PREVIEW_DOT_OFFSET_Y, mPaint);
|
||||
changePaint(mPaintOptions);
|
||||
canvas.drawPoint(getWidth()/2, getHeight() - 120, mPaint);
|
||||
canvas.drawPoint(getWidth()/2, getHeight() - Constants.PREVIEW_DOT_OFFSET_Y, mPaint);
|
||||
}
|
||||
|
||||
private void changePaint(PaintOptions paintOptions) {
|
||||
|
|
Loading…
Reference in New Issue