listview border remove when focus - android

My listview remove his border when focus or long press this way
below is my listview code please help me why border remove when focus???
everything is fine only listview border will remove whenlong presss
i edit my code please check now
<LinearLayout
android:id="#+id/lytContent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#drawable/layout_border"
android:orientation="vertical" >
<ListView
android:id="#+id/listMainMenu2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:dividerHeight="1dip"
android:fadeScrollbars="true"
android:listSelector="#drawable/listview_selector" />
</LinearLayout>
<-----listview_selector.xml---->
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="#drawable/listviewborder"
android:state_focused="true"/>
<item
android:drawable="#drawable/listview_selector_pressed"
android:state_pressed="true"/>
</selector>
<-----listviewborder.xml----->
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<solid android:color="#000000" />
</shape>
</item>
<item
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp">
<shape android:shape="rectangle" >
<gradient
android:angle="90"
android:endColor="#56768d"
android:startColor="#0a89f1" />
</shape>
</item>
</layer-list>
<------listview_selector_pressed------>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#000000" />
</shape>
</item>
<item android:left="1dp" android:right="1dp" android:top="1dp" android:bottom="1dp"
>
<shape android:shape="rectangle">
<gradient
android:startColor="#0a89f1"
android:endColor="#56768d"
android:angle="90" />
</shape>
</item>
</layer-list>
<-----layoutborder.xml--->
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#FFFFFF" />
<stroke
android:width="3dip"
android:color="#B1BCBE" />
<corners android:radius="10dip" />
<padding
android:bottom="0dip"
android:left="0dip"
android:right="0dip"
android:top="0dip" />
</shape>

Related

I want to add a shadow of a image button in round shape but cant make it

<ImageButton
android:id="#+id/btn_scan_qr"
android:layout_width="216dp"
android:layout_height="203dp"
android:elevation="10dp"
android:background="#drawable/roundbutton"
android:src="#drawable/ic_power_settings_new_black_24dp"
android:textSize="15dp"
tools:layout_editor_absoluteX="97dp"
tools:layout_editor_absoluteY="225dp"
/>
This is Xml code
<item android:state_pressed="false"
>
<shape android:shape="oval">
<corners android:radius="40dp" />
<solid android:color="#FFFFFF"
/>
<padding
android:bottom="40dp"
android:left="40dp"
android:right="40dp"
android:top="40dp" />
</shape>
</item>
This is Drawable code for shape of oval i want to add shadow of it i have used elevation but it doesnot do anything at all in constrained layout but it does in Linear layout but it is showing shadow in square but i want it in circle
Please try below code
oval shape view with shadow
custom_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list>
<item>
<shape
android:shape="oval"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#057F86A6"/>
<padding
android:top="2dp"
android:bottom="2dp"
android:right="2dp"
android:left="2dp"/>
</shape>
</item>
<item>
<shape
android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#107F86A6"/>
<padding
android:top="1.8dp"
android:bottom="1.8dp"
android:right="1.8dp"
android:left="1.8dp"/>
</shape>
</item>
<item>
<shape
android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#207F86A6"/>
<padding
android:top="1.5dp"
android:bottom="1.5dp"
android:right="1.5dp"
android:left="1.5dp"/>
</shape>
</item>
<item>
<shape
android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#357F86A6"/>
<padding
android:top="1.1dp"
android:bottom="1.1dp"
android:right="1.1dp"
android:left="1.1dp"/>
</shape>
</item>
<item>
<shape
android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#457F86A6"/>
<padding
android:top="0.9dp"
android:bottom="0.9dp"
android:right="0.9dp"
android:left="0.9dp"/>
</shape>
</item>
<item>
<shape
android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#507F86A6"/>
<padding
android:top="0.8dp"
android:bottom="0.8dp"
android:right="0.8dp"
android:left="0.8dp"/>
</shape>
</item>
<item>
<shape
android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#607F86A6"/>
<padding
android:top="0.5dp"
android:bottom="0.5dp"
android:right="0.5dp"
android:left="0.5dp"/>
</shape>
</item>
<item>
<shape
android:shape="oval" xmlns:android="http://schemas.android.com/apk/res/android">
<solid
android:color="#fff"/>
</shape>
</item>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/white"
android:orientation="vertical"
android:gravity="center">
<LinearLayout
android:layout_width="120dp"
android:layout_height="120dp"
android:gravity="center"
android:background="#drawable/custom_button">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"/>
</LinearLayout>
</LinearLayout>

Android Drawable Horizontal Line

Is it possible to make line to be like this with xml? or there's some way to do that..?
I already made some drawable with shape but it's not really like i want
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:bottomLeftRadius="30dp"
android:bottomRightRadius="30dp"
android:topLeftRadius="0dp"
android:topRightRadius="0dp" />
<padding
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp" />
<stroke
android:width="0.8dp"
android:color="#color/colorPrimaryDark" />
<solid android:color="#android:color/transparent" />
</shape>
We can create a drawable file also for this. May be helpful for someone.
Drawable file:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#android:color/white" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<stroke
android:width="5dp"
android:color="#android:color/holo_blue_dark" />
<solid android:color="#android:color/white" />
<corners android:radius="20dp" />
</shape>
</item>
<item android:bottom="25dp">
<shape android:shape="rectangle">
<stroke
android:width="2dp"
android:color="#android:color/white" />
<solid android:color="#android:color/white" />
</shape>
</item>
</layer-list>
Result :
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="-5dp"
android:insetRight="-5dp"
android:insetTop="-10dp">
<shape android:shape="rectangle">
<solid android:color="#android:color/transparent" />
<stroke
android:width="3dp"
android:color="#color/colorPrimaryDark" />
<corners
android:bottomLeftRadius="25dp"
android:bottomRightRadius="25dp" />
</shape>
</inset>
Try this
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#de0b0b" />
<solid android:color="#ffffff" />
<corners android:radius="20dp" />
</shape>
</item>
<item
android:bottom="5dp"
android:top="0dp">
<shape android:shape="rectangle">
<stroke
android:width="10dp"
android:color="#ffffff" />
<solid android:color="#android:color/transparent" />
<corners android:radius="20dp" />
</shape>
</item>
</layer-list>
USE like this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:gravity="center"
android:background="#ffffff"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/test"
android:text="Nilesh"
android:gravity="center"
android:layout_margin="#dimen/_5sdp"
android:padding="#dimen/_5sdp">
</TextView>
</LinearLayout>
OUTPUT
EDIT
Try this
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape
android:shape="rectangle">
<stroke android:width="1dp" android:color="#a032e4" />
<solid android:color="#a032e4" />
<corners android:radius="40dp"/>
</shape>
</item>
<item android:bottom="4dp" >
<shape
android:shape="rectangle">
<stroke android:width="2dp" android:color="#ffffff" />
<solid android:color="#ffffff" />
<corners android:radius="40dp"/>
</shape>
</item>
</layer-list>
USE LIKE THIS
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:gravity="center"
android:background="#FFFFFF"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/test"
android:layout_margin="20dp"
android:padding="10dp"
android:text="Nilesh Rathod"
android:gravity="center" />
</LinearLayout>
OUTPUT

How to draw vertical shape in the centre of XML drawable

How can a vertical line be drawn within an XML drawable when using a layer-list? I declared 3 shapes within the drawable but for some reason it doesn't appear as expected.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#color/green"/>
</shape>
</item>
<item android:top="0dp" android:left="1dp" android:bottom="0dp" android:right="5dp">
<shape android:shape="rectangle">
<size android:width="3dp"/>
<solid android:color="#android:color/white"/>
</shape>
</item>
<item android:top="0dp" android:left="5dp" android:bottom="0dp" android:right="1dp">
<shape android:shape="rectangle">
<size android:width="3dp"/>
<solid android:color="#android:color/white"/>
</shape>
</item>
</layer-list>
Current result
Expected result
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="16dp"
android:left="15px">
<shape
android:shape="rectangle">
<solid android:color="#color/colorAccent" />/>
<size android:width="5dip" />
<stroke android:color="#color/colorAccent" />
</shape>
</item>
<item
android:width="16dp"
android:left="80px">
<shape
android:shape="rectangle">
<solid android:color="#color/colorAccent" />/>
<size android:width="5dip" />
<stroke android:color="#color/colorAccent" />
</shape>
</item>
<item
android:width="16dp"
android:left="140px">
<shape
android:shape="rectangle">
<solid android:color="#color/colorAccent" />/>
<size android:width="5dip" />
<stroke android:color="#color/colorAccent" />
</shape>
</item>
</layer-list>
Try this solution
drawable/shape.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#color/colorAccent" />/>
<size android:width="5dip" />
<stroke
android:color="#color/colorAccent"
/>
</shape>
Include in the layout file the following
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<View
android:layout_width="15dip"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_horizontal_margin"
android:background="#drawable/shape"></View>
<View
android:layout_width="15dip"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_horizontal_margin"
android:background="#drawable/shape"></View>
<View
android:layout_width="15dip"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_horizontal_margin"
android:background="#drawable/shape"></View>
</LinearLayout>
Change the colors and fix the margins of the layout.

How to implement opposite gradient in android?

I am using this
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="7sp" />
<gradient
android:startColor="#333"
android:centerColor="#ffffff"
android:endColor="#333"
android:angle="90" />
<stroke android:width="1dp" android:color="#FFffffff" />
</shape>
</item>
But this does not give the desired effect.
You can try it this way
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#drawable/gradient"
android:orientation="vertical" >
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#drawable/gradient2"
android:orientation="vertical" >
</RelativeLayout>
</RelativeLayout>
Gradient 1
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<corners android:radius="7sp" />
<gradient
android:angle="90"
android:endColor="#D1D1D1"
android:startColor="#000" />
<stroke
android:width="1dp"
android:color="#FFffffff" />
</shape>
</item>
</layer-list>
Gradient 2
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<corners android:radius="7sp" />
<gradient
android:angle="90"
android:endColor="#000"
android:startColor="#D1D1D1" />
<stroke
android:width="1dp"
android:color="#FFffffff" />
</shape>
</item>
</layer-list>
Final Result
Use this instead
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient
android:startColor="#333"
android:centerColor="#DDD"
android:endColor="#333"
android:angle="90" />
<stroke android:width="1dp" android:color="#FF333333" />
</shape>
</item>
<item android:left="4dp" android:right="4dp" android:top="1dp" android:bottom="1dp">
<shape android:shape="rectangle">
<gradient
android:startColor="#AAA"
android:centerColor="#FFF"
android:endColor="#AAA"
android:angle="90" />
</shape>
</item>
</layer-list>
But it's better to use nine-patch images
Try
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:startColor="#4C4C43"
android:centerColor="#B8B894"
android:endColor="#4C4C43"
android:angle="270" />
</shape>
</item>
P.S - change color according to your need
reference- http://www.learn-android-easily.com/2013/06/gradient-drawable-in-android.html
Use :
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:type="linear"
android:centerX="50%"
android:startColor="#FFc0c0c0"
android:centerColor="#FFffffff"
android:endColor="#FF808080"
android:angle="270"/>
</shape>
<corners android:radius="7sp" />

how to add shadow effect on drawable in android

I have created chat bubble with drawable which looks fine, now I want to add shadow effect below the drawable so it make 3d effect.I don't want to use 9-pitch image. I just want to know how i can add shadow effect on this drawable. my code is
----right_bubble_chat_drawable
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="15dp" />
<solid android:color="#color/chatrightbubbleColor" />
<padding
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp" />
<size
android:height="#dimen/normal_button_height"
android:width="#dimen/normal_button_width" />
--- for corner pointer 'chat_laftarraow'
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item >
<rotate
android:fromDegrees="90"
android:toDegrees="-90"
android:pivotX="50%"
android:pivotY="50%" >
<rotate
android:fromDegrees="45"
android:toDegrees="45"
android:pivotX="-40%"
android:pivotY="86%" >
<shape
android:shape="rectangle" >
<stroke android:color="#00aaef" android:width="1dp"/>
<solid
android:color="#00aaef" />
</shape>
</rotate>
</rotate>
</item>
</layer-list>
------- I am using them like
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:id="#+id/left_chatArror"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_marginTop="6dp"
android:background="#drawable/chat_laftarraow"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="220dp"
android:layout_marginRight="-3dp"
android:orientation="horizontal"
android:layout_toLeftOf="#+id/left_chatArror"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:background="#drawable/right_bubble_chat_drawable">
</RelativeLayout>
</RelativeLayout>
Please suggest me how can I add shadow effect below the bubble as in the image below
You can try by implementing a layer-list that will act as the background for the LinearLayout and add your view inside this.
Quote from an answer to this question:
Add background_with_shadow.xml file to res/drawable. Containing:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<shape
android:shape="rectangle">
<solid android:color="#android:color/darker_gray" />
<corners android:radius="5dp"/>
</shape>
</item>
<item android:right="1dp" android:left="1dp" android:bottom="2dp">
<shape
android:shape="rectangle">
<solid android:color="#android:color/white"/>
<corners android:radius="5dp"/>
</shape>
</item>
</layer-list>
Then add the the layer-list as background in your LinearLayout.
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/background_with_shadow"/>
EDIT
You can create seprate xml for creating gray image like thsis:
----right_bubble_shdw_chat_drawable
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="15dp" />
<solid android:color="#android:color/darker_gray" />
<padding
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp" />
<size
android:height="#dimen/normal_button_height"
android:width="#dimen/normal_button_width" />
--- for corner pointer 'chat_laftarraow_shdw'
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item >
<rotate
android:fromDegrees="90"
android:toDegrees="-90"
android:pivotX="50%"
android:pivotY="50%" >
<rotate
android:fromDegrees="45"
android:toDegrees="45"
android:pivotX="-40%"
android:pivotY="86%" >
<shape
android:shape="rectangle" >
<stroke android:color="#android:color/darker_gray" android:width="1dp"/>
<solid
android:color="#android:color/darker_gray" />
</shape>
</rotate>
</rotate>
</item>
</layer-list>
------- I am using them like
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:id="#+id/left_chatArror"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_marginTop="6dp"
android:background="#drawable/chat_laftarraow"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="220dp"
android:layout_marginRight="-3dp"
android:orientation="horizontal"
android:layout_toLeftOf="#+id/left_chatArror"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:background="#drawable/right_bubble_chat_drawable">
</RelativeLayout>
<View
android:id="#+id/left_chatArrorShdw"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_marginTop="15dp"
android:background="#drawable/chat_laftarraow_shdw"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="220dp"
android:layout_marginRight="-3dp"
android:orientation="horizontal"
android:layout_toLeftOf="#+id/left_chatArror"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:background="#drawable/right_bubble_shdw_chat_drawable">
</RelativeLayout>
I am using this drawable/shadow.xml file
<!-- Drop Shadow Stack -->
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<solid android:color="#00CCCCCC" />
<corners android:radius="3dp" />
</shape>
</item>
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<solid android:color="#10CCCCCC" />
<corners android:radius="3dp" />
</shape>
</item>
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<solid android:color="#20CCCCCC" />
<corners android:radius="3dp" />
</shape>
</item>
<!-- Background -->
<item>
<shape>
<solid android:color="#android:color/white" />
<corners android:radius="3dp" />
</shape>
</item>
Note :- Root layout should be layer-list. Inside it add items.
Add round_big_green_down.xml as background to your position.
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/**round_big_green_down**"
android:paddingBottom="#dimen/button_margin_100"/>
res/drawable/round_big_green_down.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Drop Shadow Stack -->
<item>
<shape>
<padding android:top="1.5dp" />
<solid android:color="#00000000" />
<corners android:radius="#dimen/button_radius" />
</shape>
</item>
<item>
<shape>
<padding android:top="1.5dp" />
<solid android:color="#01000000" />
<corners android:radius="#dimen/button_radius" />
</shape>
</item>
<item>
<shape>
<padding android:top="1.5dp" />
<solid android:color="#02000000" />
<corners android:radius="#dimen/button_radius" />
</shape>
</item>
<item>
<shape>
<padding android:top="1.5dp" />
<solid android:color="#03000000" />
<corners android:radius="#dimen/button_radius" />
</shape>
</item>
<item>
<shape>
<padding android:top="1.5dp" />
<solid android:color="#04000000" />
<corners android:radius="#dimen/button_radius" />
</shape>
</item>
<item>
<shape>
<padding android:top="1.5dp" />
<solid android:color="#05000000" />
<corners android:radius="#dimen/button_radius" />
</shape>
</item>
<item>
<shape>
<padding android:top="1.5dp" />
<solid android:color="#06000000" />
<corners android:radius="#dimen/button_radius" />
</shape>
</item>
<item>
<shape>
<padding android:top="1.5dp" />
<solid android:color="#06000000" />
<corners android:radius="#dimen/button_radius" />
</shape>
</item>
<item>
<shape>
<padding android:top="1.5dp" />
<solid android:color="#06000000" />
<corners android:radius="#dimen/button_radius" />
</shape>
</item>
<item>
<shape>
<padding android:top="1.5dp" />
<solid android:color="#06000000" />
<corners android:radius="#dimen/button_radius" />
</shape>
</item>
<!-- White Top color -->
<item android:top="#dimen/button_margin_5">
<shape >
<gradient
android:angle="90"
android:endColor="#color/primary_color_50"
android:startColor="#color/primary_color_500" />
<corners
android:topLeftRadius="#dimen/button_radius"
android:topRightRadius="#dimen/button_radius"/>
</shape>
</item>
</layer-list>
res/values/dimens/
<dimen name="button_radius">25dp</dimen>

Categories

Resources