I want to draw a camera focus circle on tap on the PreviewView
. So, I wrote some code to draw a circle like below
val sd = ShapeDrawable(OvalShape())
sd.paint.color = Color.parseColor("#ffffff")
sd.paint.style = Paint.Style.STROKE
sd.paint.strokeWidth = 20f
var img: ImageView = ImageView(this);
img.background = sd
val params = FrameLayout.LayoutParams(250, 250)
params.leftMargin = event.x.toInt() - 125
params.topMargin = event.y.toInt() - 125
idFocusIndicator.removeAllViews()
idFocusIndicator.addView(img, params)
as you can clearly see below how it chopped the sides of the circle on all four sides
I need a clear circle not chopped one ! How to achieve that ?