Skip to content

Commit

Permalink
modified for picanote
Browse files Browse the repository at this point in the history
added canvas touch listener
  • Loading branch information
ajithvgiri committed Oct 7, 2020
1 parent 8a86e10 commit b2163ed
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
Binary file added .idea/caches/build_file_checksums.ser
Binary file not shown.
25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion app/src/main/java/com/ajithvgiri/drawing/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.ajithvgiri.canvaslibrary.CanvasTouchListener;
import com.ajithvgiri.canvaslibrary.CanvasView;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class MainActivity extends AppCompatActivity {
public class MainActivity extends AppCompatActivity implements CanvasTouchListener {

private CanvasView canvasView;
private RelativeLayout parentView;
Expand Down Expand Up @@ -82,4 +83,8 @@ private void saveCanvas() {
Toast.makeText(this, "Canvas Saved", Toast.LENGTH_SHORT).show();
}

@Override
public void upTouch() {

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.ajithvgiri.canvaslibrary;

public interface CanvasTouchListener {
void upTouch();
public void upTouch();
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public CanvasView(Context c, CanvasTouchListener touchListener) {
// and we set a new Paint with the desired attributes
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setColor(Color.BLACK);
mPaint.setColor(Color.RED);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeWidth(4f);
mPaint.setStrokeWidth(12f);
}

public CanvasView(Context c) {
Expand All @@ -55,10 +55,10 @@ public CanvasView(Context c) {
// and we set a new Paint with the desired attributes
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setColor(Color.BLACK);
mPaint.setColor(Color.RED);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeWidth(4f);
mPaint.setStrokeWidth(12f);
}

// override onSizeChanged
Expand Down

0 comments on commit b2163ed

Please sign in to comment.