I made round corner buttons. but when they are pressed they do not give the feel of being pressed.I want to add this effect to my buttons that when they are clicked they should give a feel like they are pressed/clicked. I created a button_rounded_corners_gradient.xml file in my drawable folder. this file contains the code which makes my button round corner and in a rectangular shape with round corners. then i am using this file in the android:background attribute of my buttons code in xml.
activity_mainn.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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:layout_height="match_parent"
tools:context="com.example.anonymous.fyplogin.MainActivity">
<Button
android:id="@+id/fbbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Login with Facebook "
android:background="@drawable/button_rounded_corners_gradient"
android:layout_marginRight="8dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginLeft="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="@+id/phbutton"
app:layout_constraintVertical_bias="0.919" />
<Button
android:id="@+id/phbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Login with Phone "
android:background="@drawable/button_rounded_corners_gradient"
android:layout_marginRight="8dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginLeft="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="71dp" />
</android.support.constraint.ConstraintLayout>
button_rounded_corners_gradient.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<!--make a gradient background-->
<gradient
android:type="linear"
android:startColor="#003333"
android:endColor="#003333"
android:centerColor="#003333"
android:angle="90"
android:gradientRadius="90"
/>
<!--apply a border around button-->
<stroke android:color="#ff0000" android:width="2dp" />
<!-- make the button corners rounded-->
<corners android:radius="25dp"/>
</shape>
</item>
</selector>