I want to change the Color and Radius of my button with single drawable file. In the Drawable file I select the color and radius for my button.But when I call it in my MainActivity.XML it is only changing the radius of Button not the color of my Button Please Help.
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="50dp"/>
<solid android:color="@color/red"/>
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LOGIN"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/button" />
Change your Application Theme from MaterialComponents
to AppCompat
for example make it Theme.AppCompat.Light.NoActionBar