// Path: backbone/src/main/java/org/researchstack/backbone/ui/callbacks/SignatureCallbacks.java
// public interface SignatureCallbacks {
//     void onSignatureStarted();
// 
//     void onSignatureCleared();
// }


import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.CornerPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.shapes.PathShape;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import org.researchstack.backbone.R;
import org.researchstack.backbone.ui.callbacks.SignatureCallbacks;
import java.util.ArrayList;
import java.util.List;
        SignatureSavedState ss = (SignatureSavedState) state;
        super.onRestoreInstanceState(ss.getSuperState());

        sigPoints = ss.points;
        sigPath.rewind();

        for (LinePathPoint point : sigPoints) {
            if (point.isStartPoint()) {
                sigPath.moveTo(point.x, point.y);
            } else {
                sigPath.lineTo(point.x, point.y);
            }
        }
    }

    public void clearSignature() {
        sigPath.rewind();
        sigPoints.clear();

        ViewCompat.postInvalidateOnAnimation(this);

        if (callbacks != null) {
            callbacks.onSignatureCleared();
        }
    }

    public boolean isSignatureDrawn() {
        return !sigPath.isEmpty();
    }

// Path: backbone/src/main/java/org/researchstack/backbone/ui/callbacks/SignatureCallbacks.java
// public interface SignatureCallbacks {
//     void onSignatureStarted();
// 
//     void onSignatureCleared();
// }


// Path: backbone/src/main/java/org/researchstack/backbone/ui/views/SignatureView.java
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.CornerPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.shapes.PathShape;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import org.researchstack.backbone.R;
import org.researchstack.backbone.ui.callbacks.SignatureCallbacks;
import java.util.ArrayList;
import java.util.List;

        SignatureSavedState ss = (SignatureSavedState) state;
        super.onRestoreInstanceState(ss.getSuperState());

        sigPoints = ss.points;
        sigPath.rewind();

        for (LinePathPoint point : sigPoints) {
            if (point.isStartPoint()) {
                sigPath.moveTo(point.x, point.y);
            } else {
                sigPath.lineTo(point.x, point.y);
            }
        }
    }

    public void clearSignature() {
        sigPath.rewind();
        sigPoints.clear();

        ViewCompat.postInvalidateOnAnimation(this);

        if (callbacks != null) {
            callbacks.onSignatureCleared();
        }
    }

    public boolean isSignatureDrawn() {
        return !sigPath.isEmpty();
    }

    public void setCallbacks(SignatureCallbacks callbacks) {