Issue
I have worked with android studio previously also, and have designed custom buttons and it use to get applied but recently I am getting issue that the colors are not being applied, shape and corner radius get applied but color doesn't, it remains purple.
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="20dp"></corners>
<solid android:color="#11fa30"></solid>
</shape>
I have saved this file in drawable folder. also I have applied it to the background of the button
<Button
android:id="@+id/stop_rec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textStyle="bold"
android:layout_margin="1dp"
android:background="@drawable/button_pressed"
android:text="@string/stop_r" />
shape is being applied but not the color. Can someone please guide why am I facing this issue.
Solution
Add this line to your button's xml code :
app:backgroundTint="@null"
Answered By - DrHowdyDoo