I was creating a shape to use as a button background. I'm making a strip of buttons, and the one on the left edge is going to have rounded corners on the left, and the last one on the right will have rounded corners on the right. This is pretty simple, and the api docs show you just how to do it. However, when I used android:topLeftRadius
and android:bottomLeftRadius
, the result in the UI was as if I put bottomRightRadius. The same behavior was true of the other side. It appears that whoever implemented this swapped bottomRight and bottomLeft. I'll post a snippet of the code below.
Is there some logical reason for this that I might be missing? Or, if this was a mistake on the part of the Android engineers, will it stay backward compatible once they fix it? I imagine they'd have to make all new attributes to keep the old ones valid (leftTop instead of topLeft maybe?).
<?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>