I am trying to implement eraser that can change also the opacity of the drawpath. I try to change the alpha and still not working.
This is the the code:
var mPaint = Paint()
mPaint!!.isAntiAlias = true
mPaint!!.isDither = true
mPaint!!.xfermode = PorterDuffXfermode(PorterDuff.Mode.CLEAR)
mPaint!!.style = Paint.Style.STROKE
mPaint!!.strokeJoin = Paint.Join.ROUND
mPaint!!.strokeCap = Paint.Cap.ROUND
mPaint!!.strokeWidth = mStrokeWidth
mPaint!!.alpha = 0