Расположение кнопок в форме ромба в Android XML
Я хотел бы создать экран с четырьмя кнопками, каждая в форме ромба (как квадрат, повернутый на 45 градусов в сторону), и все четыре расположены в виде большего ромба.
Я искал здесь на SO и сумел создать этот XML-файл, который намекает на то, чего я хочу достичь:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/White"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:id="@+id/scoreCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge">
</TextView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:layout_weight="1.0" >
<Button
android:id="@+id/topLeftOuter"
android:layout_centerInParent="true"
android:layout_width="60dp"
android:layout_height = "60dp"
android:background="@color/Blue"
android:clickable="true"
android:visibility="visible"
android:adjustViewBounds="true"
android:rotation="45" >
</Button>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:clickable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:layout_weight="1.0" >
<Button
android:id="@+id/bottomLeftOuter"
android:layout_centerInParent="true"
android:layout_width="60dp"
android:layout_height = "60dp"
android:background="@color/Yellow"
android:clickable="true"
android:visibility="visible"
android:adjustViewBounds="true"
android:rotation="45" >
</Button>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:layout_weight="1.0" >
<Button
android:id="@+id/bottomRightOuter"
android:layout_centerInParent="true"
android:layout_width="60dp"
android:layout_height = "60dp"
android:background="@color/Red"
android:clickable="true"
android:visibility="visible"
android:adjustViewBounds="true"
android:rotation="45" >
</Button>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:clickable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:layout_weight="1.0" >
<Button
android:id="@+id/topRightOuter"
android:layout_centerInParent="true"
android:layout_width="60dp"
android:layout_height = "60dp"
android:background="@color/Chartreuse"
android:clickable="true"
android:visibility="visible"
android:adjustViewBounds="true"
android:rotation="45" >
</Button>
</RelativeLayout>
</LinearLayout>
Это результат:
Но я хотел бы что-то еще в этом духе:
Как я должен идти туда?