I created a form to use as the button background. I’m making a strip of buttons, and on the left edge there will be rounded corners on the left, and rounded corners on the right. It is quite simple, and api docs show you how to do it. However, when I used android:topLeftRadiusand android:bottomLeftRadius, the result in the user interface was as if I placed bottomRightRadius. The same behavior was true for the other side. It seems whoever implemented this has replaced bottomRight and bottomLeft. I will post the code snippet below.
Is there any logical reason for this that I can skip? Or, if it was a mistake on the part of Android engineers, will it remain backward compatible after fixing them? I assume that they would have to use all the new attributes so that the old ones are valid (e.g. leftTop instead of topLeft?).
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<solid android:color="#99000000" />
<padding
android:top="8dp"
android:left="8dp"
android:right="8dp"
android:bottom="8dp" />
<corners
android:topLeftRadius="8dp"
android:bottomRightRadius="8dp" />
</shape>
</item>
source
share