Saturday, 3 September 2011

sample buttons

base button:

<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android"

        android:constantSize ="true">

    <item android:state_pressed="true" android:drawable="@drawable/black_pressed" />

    <item android:drawable="@drawable/black_normal" />

</selector>




button in normal state:

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"

       android:shape="rectangle" >

    <gradient

            android:startColor="#666666"

            android:endColor="#000000"

            android:angle="270"/>

    <corners android:radius="10sp"/>

    <stroke android:color="#000000"

            android:width="1sp"/>

</shape>



button in pressed state:

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"

       android:shape="rectangle">

    <gradient

            android:startColor="#666666"

            android:endColor="#AAAAAA"

            android:angle="90"/>

    <corners android:radius="10sp"/>

    <stroke android:color="#000000"

            android:width="2sp"/>

</shape>


1 comment:

  1. Amazing Post!
    I love it. Will come back again - taking your feeds also.
    Thanks.
    iCaption That

    ReplyDelete