Q: How to add different drawing objects like circle, triangle, and rectangle on image in android How to draw different object like a circle, rectangle, square, triangle, etc. on image and after adding an object it can be enlarged, dragged and shrink.
I have at present added a circle of fixed size on image. 
I have implemented below code which adds circle on an image but I'm unable to enlarge, shrink or drag my object on the image.
class ViewEditImage:AppCompatActivity(), View.OnClickListener{
internal var bitmap: Bitmap? = null
internal var  mutableBitmap:Bitmap? = null
private var activity: Activity? = null
/*Toolbar*/
private var toolbar: Toolbar? = null
private var toolbarTitle: TextView? = null
private var then: Long = 0
private val matrix = Matrix()
private val savedMatrix = Matrix()
private val start = PointF()
private var mode = ViewEditImage.NONE
private var lastEvent: FloatArray? = null

companion object {
    var bitmap: Bitmap? = null
    var resultfinal: Bitmap? = null
    // we can be in one of these 3 states
    private val NONE = 0
    private val DRAG = 1
    private val ZOOM = 2
}

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.edit_image_activity)
    activity = this

    val myUri = Uri.parse(intent.getStringExtra("BitmapImage"))
     bitmap = MediaStore.Images.Media.getBitmap(this.contentResolver, myUri)
    bitmap = Bitmap.createScaledBitmap(bitmap, 240, 240, false)

    Glide.with(activity!!)
        .load(myUri)
        .into(editImageView)
    editImageView.setScaleType(ImageView.ScaleType.FIT_XY);


    initializeHeader()
    init()

}

private fun initializeHeader() {
    toolbar = findViewById(R.id.toolbar)
    toolbarTitle = findViewById(R.id.txt_toolbar_title)
    setSupportActionBar(toolbar);
    supportActionBar!!.setDisplayShowTitleEnabled(false)
    toolbarTitle!!.text = resources.getString(R.string.editImage)
}

fun init(){
    rotateRightImageButton.setOnClickListener(this)
    rotateLeftImageButton.setOnClickListener(this)
    circleButton.setOnClickListener(this)

}

override fun onClick(v: View?) {
    if(v==rotateRightImageButton){
        val matrix = Matrix()
        matrix.postRotate(90f)

       bitmap = Bitmap.createBitmap(
            bitmap, 0, 0, bitmap!!.getWidth(), bitmap!!.getHeight(),
            matrix, true
        )


        editImageView.setImageBitmap(bitmap)
        editImageView.setScaleType(ImageView.ScaleType.FIT_XY);
    }
    if(v==rotateLeftImageButton){
        val matrix = Matrix()
        matrix.postRotate(-90f)

        bitmap = Bitmap.createBitmap(
            bitmap, 0, 0, bitmap!!.getWidth(), bitmap!!.getHeight(),
            matrix, true
        )


        editImageView.setImageBitmap(bitmap)
        editImageView.setScaleType(ImageView.ScaleType.FIT_XY);
    }
    if(v == circleButton){

        val myOptions = BitmapFactory.Options()
        myOptions.inDither = true
        myOptions.inScaled = false
        myOptions.inPreferredConfig = Bitmap.Config.ARGB_8888
        myOptions.inPurgeable = true


        val paint = Paint()
        paint.isAntiAlias = true
        paint.color = Color.BLUE


        val workingBitmap = Bitmap.createBitmap(bitmap)
        mutableBitmap = workingBitmap.copy(Bitmap.Config.ARGB_8888,         true)


        val canvas = Canvas(mutableBitmap)
        canvas.drawCircle(60f, 50f, 25f, paint)

        editImageView.adjustViewBounds = true
        editImageView.setImageBitmap(mutableBitmap)

    }
}

}
