This is the background for a login button (login_button_bk):
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="27dp" />
<gradient
android:angle="45"
android:centerX="35%"
android:endColor="#79EBFD"
android:startColor="#408bff"
android:type="linear" />
<size
android:width="182dp"
android:height="54dp" />
</shape>
This is the button Im applying the background to :
<Button
android:id="@+id/btn_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/loginViewsMargin"
android:background="@drawable/login_button_bk"
android:text="Login" />
This is the styles.xml :
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Still, the button is just Black without the drawable applied. How to fix it ?