I want create this using button (TextView) by using XML definiton:
In layout of the Activity I have:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_arrow" <!-- I NEED IMPLEMENT THIS -->
android:clickable="true"
android:drawablePadding="7dp"
android:gravity="center"
android:drawableLeft="@drawable/music_cloud"
android:onClick="exportSong"
android:padding="20dp"
android:text="@string/export_upload"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/dark_yellow_text_color"
android:textStyle="bold" />
I founded several posts:
making-a-triangle-shape-using-xml-definitions
Android triangle (arrow) defined as an XML shape
or Android - make an arrow shape with xml
I tried modify several XML definition but nothing was good. Is there some easy way how to implement this shape? Also it should have a transparent background.
If someone still has issues with this :
xml:
override TextView and use it in your layout:
Regarding the xml example: there are two rectangles overlapping.You have to play around with the values a lot and this makes it difficult to use on different views. I think using a custom view is the best solution in this case.