tankery / CircularSeekBar

Custom circular SeekBar (Circle, Semi-circle, and Ellipse) for Android
Apache License 2.0
376 stars 60 forks source link

how to move pointer outside the circle #14

Closed MohdAsifAhmed closed 6 years ago

MohdAsifAhmed commented 6 years ago

I have a requirement like adding image drawable to the pointer and that drawable is outside the circle. I need to move the drawable to change progress. I did changes to add drawable instead of pointer circle, but how to move this drawable outside the circle. I tried like this

canvas.drawBitmap(bitmap, mPointerPositionXY[0] , mPointerPositionXY[1] , mPaint);

This is showing the bitmap but i need to set this drawable outside the circle.

From the code, i just got the radius till the circle border.

Please help me. Thanks in advance

tankery commented 6 years ago

Hi, I think the problem you've faced is that the view's boundary is too small to contain your bitmap.

Maybe you need to modify the onMeasure method to take the bitmap size into consider when calculate the view's width and height.