I need to make something that allows a user to drag between triangular views, and that will send drag events for each view. However, with all triangular buttons I try to implement, the button calls onclick even when a user taps a point not in the triangle but in its bounding box.
Button xml (to make triangular shape):
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<rotate
android:fromDegrees="45"
android:toDegrees="45"
android:pivotX="-40%"
android:pivotY="87%" >
<shape
android:shape="rectangle" >
<stroke android:color="@android:color/transparent" android:width="10dp"/>
<solid
android:color="@color/red" />
</shape>
</rotate>
</item>
</layer-list>
Button added to MainActivity xml:
<Button
android:id="@+id/triangle1"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/triangle" />
How could I fix this?