mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-06-05 21:59:17 +02:00
Dynamic preview dot background + offset numbers converted to constants
This commit is contained in:
@ -9,4 +9,7 @@ public class Constants {
|
|||||||
public static final String IS_FIRST_RUN = "is_first_run";
|
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_DARK_THEME = "is_dark_theme";
|
||||||
public static final String IS_STROKE_WIDTH_BAR_ENABLED = "is_stroke_width_bar_enabled";
|
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) {
|
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(100);
|
mPaint.setStrokeWidth(mPaintOptions.strokeWidth + Constants.PREVIEW_DOT_STROKE_SIZE);
|
||||||
canvas.drawPoint(getWidth()/2, getHeight() - 120, mPaint);
|
canvas.drawPoint(getWidth()/2, getHeight() - Constants.PREVIEW_DOT_OFFSET_Y, mPaint);
|
||||||
changePaint(mPaintOptions);
|
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) {
|
private void changePaint(PaintOptions paintOptions) {
|
||||||
|
Reference in New Issue
Block a user