I looked at it and played around with it to better understand the ShapeDrawable library.
Below is the code snippet pulled from ShapeDrawable1.java
float[] outerR = new float[] { 35, 35, 35, 35, 0, 0, 0, 0 };
RectF inset = new RectF(6, 6, 6, 6);
float[] innerR = new float[] { 12, 12, 0, 0, 12, 12, 0, 0 };
mDrawables[4] = new ShapeDrawable(new RoundRectShape(outerR, inset, innerR));
So let's focus on the parameters on RoundRectShape().
- inset defines the shape of the rectangle that will be inside our RoundRectShape. It basically defines where the left side, right side, top and bottom of the rectangle will be.
- outerR defines the the radius of the outer corner of the RoundRectShape. So in this case, we've defined the top left and top right corners of RoundRectShape to have a rounded corner of 35. The larger the numbers, the curvier your corner will look.
- innerR defines the radius of the inner corner of the RoundRectShape. Once more, the larger the numbers, the curvier your corner will look.
I recommend you try changing the numbers on your own to get a better feel for what the numbers of outerR and innerR do.
I still haven't figured out how the PathShape works. When I do, I'll add it this blog.
Not sure if this post really answered my question, but I love that I found your blog. I'm a programmer/mom as well, though I stopped working after my second was born.
ReplyDeleteIt is interesting to read your perspective. Before having kids I worked at a very small company where there was only one other developer. It was a low stress work environment, but as such, paid quite a bit less. It was good $$ for entry level, but didn't really scale.
Now that my kids are getting older I decided to try my hand at mobile apps. In March I released my first android app and am hoping to release my next one within the next week or two.