I see everywhere in my project code like this, when buttons are declared in background, instead of usual Button. Developer who did this - not working now. Why is it done like this? Are there some performance winning? Or what reasons? And how I can do the same effect with ConstraineLayout? Thanks.
<android.support.v7.widget.CardView
android:id="@+id/confirm_phone_btn_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/confirm_phone_text_input_layout"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="22dp"
android:layout_marginTop="32dp"
android:background="@color/edit_info_btn_inactive"
app:cardBackgroundColor="@color/blue"
app:cardCornerRadius="3dp"
app:cardElevation="2dp"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="false">
<TextView
android:id="@+id/confirm_phone_change_txt"
android:layout_width="118dp"
android:layout_height="36dp"
android:layout_gravity="center_horizontal"
android:background="@color/edit_info_btn_inactive"
android:clickable="true"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/change"
android:textAllCaps="true"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
</android.support.v7.widget.CardView>