Open gbrbks opened 5 years ago
Hello, I have this same requirement and spent some time figuring it out. You will have to fork/clone the project to do this. The file you need to edit is CircularProgressAnimatedDrawable.kt
in the fun onDraw(canvas: Canvas)
method you need to add this line:
canvas.translate((progressButton.getWidth() - progressButton.finalWidth)/2f, 0f)
Make sure the function is now like this:
override fun draw(canvas: Canvas) {
val (startAngle, sweepAngle) = getAngles()
canvas.translate((progressButton.getWidth() - progressButton.finalWidth)/2f, 0f)
canvas.drawArc(fBounds, startAngle, sweepAngle, false, paint)
}
Hey!
My plan is to modify the library to have a certain width when the loading started. Actually removed the width animation to stay in the original width. However, in this scenario, the loader is drawn at the left side of the button, not in the center. Is there any way to move it to the center?
Thanks in advance!