Drawing Library

Additional

Language
Java
Version
v1.1.3 (Oct 7, 2020)
Created
Oct 31, 2017
Updated
Oct 7, 2020 (Retired)
Owner
Ajith v Giri (ajithvgiri)
Contributor
Ajith v Giri (ajithvgiri)
1
Activity
Badge
Generate
Download
Source code

Drawing App Library

Simple android library for drawing

Setup

1. Provide the gradle dependency

Add it in your root build.gradle at the end of repositories:

 allprojects {
  repositories {
   ...
   maven { url 'https://jitpack.io' }
  }
 }

Add the gradle dependency to your app module build.gradle file:

 dependencies {
         compile 'com.github.ajithvgiri:Canvas-Library:v1.1.1'
 }

2. Add the Canvas View view to your Relative Layout xml file

Make sure layout_width and layout_height are match-parent. and make sure the background of the layout must be white

         <RelativeLayout
                android:id="@+id/parentView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#FFFFFF" />

3. Add the canvas view to the layout

        RelativeLayout parentView = findViewById(R.id.parentView);
        CanvasView canvasView = new CanvasView(this);
        parentView.addView(canvasView);

To clear the drawing

        canvasView.clearCanvas();