androidandroid-drawableandroid-buttonandroid-shapematerial-components-android

Why we need to create shapes if i need a little border radius for the buttons?


For example in CSS i will be using the property border-radius: 10px. So this single property saves me from extra overhead.

I searched all over the internet and found that all are doing shapes in android. Why in android we need to go for shapes (extra overhead) to make a button having a rounded corners and so on. Why shapes concept was created in android. If there is Button then there should also be the border radius kind of property.

Don't you think that the android development support is incomplete?

Whats the story behind this? Thanks in advance!!!


Solution

  • The points made in the comments seem to partially answer your question but I just wanted to point out that it doesn't seem you are comparing apples to apples. HTML and XML are declarative languages while CSS is a style sheet language.

    You'd be able to use HTML to make a button but would not be able to style it and add a corner as you mentioned.

    When seen this way it makes sense why XML allows us to style components such as Buttons using shapes and drawables in general. This may not be the actual reason but the way I see it is that XML tries to cover what HTML and CSS do together and the "extra overhead" is simply what CSS would have done in web dev.

    Would love to hear other opinions, though.