0

I am making a rounded and bordered button. But I am getting button with only primary color in the theme. Here is my code in circular button drawable file:-

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/green" />
    <corners android:radius="50dp" />
    <stroke
        android:width="10dp"
        android:color="@color/red_primary" />
</shape>

here is my button code:-

               <Button
                android:id="@+id/feedback_btn"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginHorizontal="5dp"
                android:layout_weight="1"
                android:padding="10dp"
                android:background="@drawable/circular_button"
                android:text="@string/send_feedback"
                android:textColor="@color/white" />
CHETAN
  • 380
  • 1
  • 3
  • 15

2 Answers2

0
also add app:backgroundTint="@null" in Button tag.
Vishal Vasani
  • 647
  • 8
  • 16
0

you can use bewlo code for rounded and bordered button

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/BlueDark"/>
    <stroke android:width="3dp" android:color="@color/White" />
    <corners android:bottomRightRadius="30dp"
        android:topRightRadius="30dp"
        android:topLeftRadius="30dp"
        android:bottomLeftRadius="30dp"/>

    <padding android:left="0dp" android:top="0dp"
        android:right="0dp" android:bottom="0dp" />
</shape>

Also YOU can set boder wedith with bewlo line

<stroke android:width="3dp" android:color="@color/White" />
Codeplayon
  • 429
  • 1
  • 6
  • 16