This is part of my layout. I need buttons to be perfect squares. There will be 4 buttons in row. There will be more rows in scrollview. Every row will fit the screen width for any screen size. I have tried ton of solutions but nothing works as I want to. Then also I need to have the text dynamic as the buttons so it everytime fills the button width. Is there any solution? I am trying this for weeks.
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp">
<Button
android:id="@+id/button4"
android:layout_width="match_parent"
android:text="@string/r1960"
android:textColor="#ffffff"
android:textSize="@dimen/loptatext"
android:shadowColor="#000000"
android:shadowRadius="7"
android:layout_weight="1"
android:background="@drawable/tlacitko_stav" />
<Button
android:id="@+id/button5"
android:layout_width="match_parent"
android:text="@string/r1964"
android:textColor="#ffffff"
android:textSize="@dimen/loptatext"
android:shadowColor="#000000"
android:shadowRadius="7"
android:layout_weight="1"
android:background="@drawable/tlacitko_stav" />
<Button
android:id="@+id/button6"
android:layout_width="match_parent"
android:text="@string/r1968"
android:textColor="#ffffff"
android:textSize="@dimen/loptatext"
android:shadowColor="#000000"
android:shadowRadius="7"
android:layout_weight="1"
android:background="@drawable/tlacitko_stav" />
<Button
android:id="@+id/button7"
android:layout_width="match_parent"
android:text="@string/r1972"
android:textColor="#ffffff"
android:textSize="@dimen/loptatext"
android:shadowColor="#000000"
android:shadowRadius="7"
android:layout_weight="1"
android:background="@drawable/tlacitko_stav" />
</TableRow>