diff --git a/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java b/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java index a53c11e..5402400 100644 --- a/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java +++ b/app/src/main/java/com/simplemobiletools/draw/MyCanvas.java @@ -85,6 +85,13 @@ public class MyCanvas extends View { canvas.drawPath(mPath, mPaint); } + public void clearCanvas(){ + mPath = new Path(); + mPaths = new LinkedHashMap<>(); + pathsUpdated(); + invalidate(); + } + private void actionDown(float x, float y) { mPath.reset(); mPath.moveTo(x, y); 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 7da1661..3981cac 100644 --- a/app/src/main/java/com/simplemobiletools/draw/activities/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/draw/activities/MainActivity.java @@ -84,6 +84,9 @@ public class MainActivity extends SimpleActivity implements MyCanvas.PathsChange case R.id.settings: startActivity(new Intent(getApplicationContext(), SettingsActivity.class)); return true; + case R.id.clear: + mMyCanvas.clearCanvas(); + return true; case R.id.about: startActivity(new Intent(getApplicationContext(), AboutActivity.class)); return true; diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml index 628228b..c5b4435 100644 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu.xml @@ -15,6 +15,10 @@ android:id="@+id/settings" android:title="@string/settings" app:showAsAction="never"/> + Settings + Clear Dark theme