The background color of the button won't change.
Here is the code:
<?xml version="1.0" encoding="utf-8"?>
 <androidx.constraintlayout.widget.ConstraintLayout 
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   android:background="@color/purple_500">
<Button
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:layout_margin="5dp"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    android:background="@color/white"/>
</androidx.constraintlayout.widget.ConstraintLayout>
This is what the layout and blueprint looks like:
