I use this library in my project but i get an error:
class 'com.android.graphics.CanvasView' not found
How i can fix it?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<com.android.graphics.CanvasView
android:id="@+id/canvas"
android:layout_width="match_parent"
android:layout_height="600dp"
android:layout_gravity="center_horizontal" />
</LinearLayout>
in java code :
package com.example.falah.paint2;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class DrawActivity extends AppCompatActivity {
private CanvasView canvas;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_draw);
canvas = (CanvasView)this.findViewById(R.id.canvas);
}
}
As per our discussions in the comments,
The owner of this repository does not have this library hosted on any service like JitPack or JCenter, else adding this library should be simply be adding a single line of code in your app level build.gradle file.
For now you can either download the code from their repository here and paste it in a file named CanvasView.java
You will need to update the package name accordingly in both the CanvasView.java and the layout file where you use com.android.graphics.CanvasView and replace it with com.example.falah.paint2.CanvasView