SketchView Library & Sample
SketchView library provides a custom implementation of a canvas on which user can draw via gestures.
SketchView sample is a template-like sketch editor with following basic actions:
-
Set brush color (from a range of available colors).
-
Set brush size (from a set of available sizes).
-
Set eraser size (from a set of available sizes).
-
Set image as background of the sketch.
-
Undo option (all gestures can be undone).
-
Save sketch.
-
Share sketch.
Further improvement:
- Add support for zoom in/out and translation via gestures to SketchView.
How to use
Simply put SketchView into your layout:
<com.skd.sketchview.SketchView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/sketchView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
To manipulate SketchView use its public methods:
- setBrushes()
- setSketchBackground()
- setGestureColorAndSize()
- undoLastGesture()
- getSketchBimap()
More details are in SketchView sample.