I have created my custom button for my card-view in android using Relative Layout and calling that button via <include layout functionality. Everything is working fine I just want to know put ripple effect on that click how to do that?
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="125dp"
android:layout_height="30dp"
android:background="@color/colorPrimary"
android:layout_gravity="center_horizontal"
android:focusableInTouchMode="true">
<TextView
android:layout_width="125dp"
android:layout_height="30dp"
android:fontFamily="@font/questa"
android:text="Know More"
android:gravity="center"
android:textAllCaps="false"
android:textColor="#ffffff">
</TextView>
</FrameLayout>
</RelativeLayout>
Include Layout Code:
<include
android:id="@+id/btnViewDetails"
style="@style/CardView.Button"
layout="@layout/button"
android:layout_width="125dp"
android:layout_height="30dp"
android:layout_below="@+id/viewDivider"
/>