I have two packages with one that is the primary package with the MainActivity
. The other package gets imported into the MainActivity
. The other package deals with drawing on a canvas. However, any changes that I am making to the imported package are not showing up on the actual app. For example, when i change the size of the rectangle being drawn, nothing is actually changing. Does anyone know why this is?
Sorry if this is a trivial question, I just started learning android dev. Also, I got the code off of github, and i'm trying to learn from it. If there is any information that I left out that is crucial please ask. Thank
The code is from: https://github.com/husaynhakeem/android-face-detector
The specific part that I had tried to change is the ANCHOR_RADIUS
, ID_OFFSET
, as well as the xOffset
, yOffset
values in the FaceBoundsOverlay
. Each variable affects some boundary that is supposed to be used to draw the rectangle and center dot. I pasted the drawAnchor
method down below. In that method, when I changed the ANCHOR_RADIUS
to 50f
, I expected the dot to become larger but nothing was changed.
The FaceBoundsOverlay
is in the package called facedetector while the MainActivity
is in the package called facedetectorapp
class FaceBoundsOverlay @JvmOverloads constructor(
ctx: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0) : View(ctx, attrs, defStyleAttr) {
.....
private fun drawAnchor(canvas: Canvas, centerX: Float, centerY:
Float) { private fun drawAnchor(canvas: Canvas, centerX: Float,
centerY: Float) {
canvas.drawCircle(
centerX,
centerY,
ANCHOR_RADIUS,
anchorPaint)
}
companion object {
private const val ANCHOR_RADIUS = 10f
// private const val ANCHOR_RADIUS = 50f
private const val ID_OFFSET = 50f
}
}