dialog - Android - drawable with rounded corners at the top only not work below-v14 -
i trying make dialog round corner button. it's not working below api_level14
i trying this there no solution. if have solution below api-14 share it.
for below api 14 it's show
and it's works api level 14 , above
for right_below_corner.xml
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false"><shape android:shape="rectangle"> <solid android:color="@color/header_bg_disable" /> <corners android:topleftradius="0dp" /> <corners android:toprightradius="0dp" /> <corners android:bottomleftradius="0dp" /> <corners android:bottomrightradius="10dp" /> <stroke android:width="1dp" android:color="@color/header_bg_disable" /> <padding android:bottom="4dp" android:left="4dp" android:right="4dp" android:top="4dp" /> </shape></item> <item android:state_pressed="true"><shape android:shape="rectangle"> <solid android:color="@color/header_bg_press" /> <corners android:topleftradius="0dp" /> <corners android:toprightradius="0dp" /> <corners android:bottomleftradius="0dp" /> <corners android:bottomrightradius="10dp" /> <stroke android:width="1dp" android:color="@color/header_bg_press" /> <padding android:bottom="4dp" android:left="4dp" android:right="4dp" android:top="4dp" /> </shape></item> <item android:state_pressed="false"><shape android:shape="rectangle"> <solid android:color="@color/header_bg" /> <corners android:topleftradius="0dp" /> <corners android:toprightradius="0dp" /> <corners android:bottomleftradius="0dp" /> <corners android:bottomrightradius="10dp" /> <stroke android:width="1dp" android:color="@color/header_bg" /> <padding android:bottom="4dp" android:left="4dp" android:right="4dp" android:top="4dp" /> </shape></item> </selector>
and bottom_left_corner.xml
is
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"><shape android:shape="rectangle"> <solid android:color="@color/header_bg_press" /> <corners android:bottomleftradius="10dp" /> <corners android:topleftradius="0dp" /> <corners android:toprightradius="0dp" /> <corners android:bottomrightradius="0dp" /> <stroke android:width="1dp" android:color="@color/header_bg_press" /> <padding android:bottom="4dp" android:left="4dp" android:right="4dp" android:top="4dp" /> </shape></item> <item android:state_pressed="false"><shape android:shape="rectangle"> <solid android:color="@color/header_bg" /> <corners android:topleftradius="0dp" /> <corners android:toprightradius="0dp" /> <corners android:bottomrightradius="0dp" /> <corners android:bottomleftradius="10dp" /> <stroke android:width="1dp" android:color="@color/header_bg" /> <padding android:bottom="4dp" android:left="4dp" android:right="4dp" android:top="4dp" /> </shape></item> </selector>
yes, there bug in android until version 3.1. when specifying corners separately, bottom left , right corners flipped: http://code.google.com/p/android/issues/detail?id=9161
the solution make separate xml-files 2 versions. this:
res/drawable/corners.xml – reversed values
res/drawable-v12/corners.xml – normal values
Comments
Post a Comment