Search code examples
android-layoutandroid-xmlandroid-custom-drawable

How do I achieve the following xml layout?


Layout made by me

enter image description here

Layout I want to achieve

enter image description here

orange_hollow_fill_round_corner.xml (Custom Drawable)

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <corners android:radius="15dp" />

    <stroke
        android:width="1dp"
        android:color="@color/orange" />

    <size
        android:width="80dp"
        android:height="20dp" />

</shape>

enter image description here

I want to make custom drawable like shown below so that the it does not cut Earned Badges Text view.

made in paint

Please ignore differences in corner and colors of my layout and layout that I want to achieve.


Solution

  • you can do it by just add background to textView (Earned Badges) this background has corner and black color by android:background="@drawable/your_custom_button" it will overlap on orange stork .

    I hope it will help you .