Android: Roundrectshape: Modify Corner Radii
Solution 1:
I think you don't need to use RoundRectShape at all. RoundRectShape is immutable so the only way to change its values is to use reflection.
You can easily accomplish the same drawnings by calling Canvas.drawRoundRect(RectF rect, float rx, float ry, Paint paint) method directly without using RoundRectShape. Or you can look at RoundRectShapeimplementation and just use its code in your onDraw() method.
EDIT:
The comments about RoundRectShape not being the right way to go and looking at the implementation were right. Following the implementation found a call to:
mPath.addRoundedRect()
which has a variation allowing a float of corner radii as the input (Path.addRoundRect)
In answering the question:
Use a path instead of a shape as the variable and draw the new Rounded Rectangle to the path when necessary
Post a Comment for "Android: Roundrectshape: Modify Corner Radii"