I have a custom gridview with items like that
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center"
android:longClickable="false"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:longClickable="false"
android:text="0"
android:textSize="60sp" />
</LinearLayout>
I want my items to be squares and I want gridview to stretch width to fill all all width of screen in portrait orientation and all height in landscape orientation.
It should look like this
Where A - is the side of a square and B is the margin width (it could be zero). I think that I should probably override onMeasure method, but what exactly should I do? Maybe anyone can help?
EDIT OK, I tried to set width and height of items manually in getView method of adapter, it's better, but still it's not what I wanted. How can I get rid of that spacing between columns?