Search code examples
androidbuttonandroid-buttonmaterial-components-androidandroid-vectordrawable

How to create a button like the picture


I want to create a shape for buttons like this picture but I don't know how to use shape for creating a button like the picture.

button picture


Solution

  • Try below background vector drawable for something like enter image description here

    <?xml version="1.0" encoding="utf-8"?>
    <vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="40dp"
        android:height="40dp"
        android:viewportWidth="80"
        android:viewportHeight="100">
        <group android:name="rotationGroup">
            <path
                android:pathData="M 5,5 L 75,5 75,25 12,25 5,16 5,5"
                android:strokeWidth="1"
                android:fillColor="#44008080"
                android:strokeColor="#008080"
                android:trimPathStart="0"
                android:trimPathEnd="1" />
        </group>
    
    </vector>