I looked all over for examples and I hardly saw any floating action button with an icon and text view on it.
I want my MyCartBtn with icon and text on it. So the idea is the count of the cart changes dynamically so I know how to set that code
public class MyCartBtn extends FloatingActionButton {
private Context mContext;
private MyTextView mTextView;
}
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"
android:background="@color/transparent">
<com.panera.bread.common.views.MyCartBtn
android:id="@+id/cart_btn"
android:layout_width="95dp"
android:layout_height="95dp"
android:background="@drawable/circular_icon"
/>
<com.panera.bread.common.views.MyTextView
android:id="@+id/cart_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:textColor="@android:color/white"/>
</RelativeLayout>```