8000 Use GridLayout to show grid of Images instead of RelativeLayout · commons-app/apps-android-commons@fb070ab · GitHub
Skip to content

Commit fb070ab

Browse files
committed
Use GridLayout to show grid of Images instead of RelativeLayout
1 parent d88fd72 commit fb070ab

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

app/src/main/res/layout-land/welcome_do_upload.xml

+5-12
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
>
1010

1111

12-
<RelativeLayout
13-
android:gravity="center"
12+
<GridLayout
1413
android:layout_width="300dp"
15-
android:layout_height="match_parent"
14+
android:layout_height="wrap_content"
15+
android:layout_gravity="center_vertical"
1616
android:layout_marginLeft="10dp"
1717
android:layout_marginRight="10dp"
18+
android:columnCount="2"
1819
>
1920

2021
<ImageView
@@ -30,7 +31,6 @@
3031
android:id="@+id/llamas"
3132
android:layout_width="150dp"
3233
android:layout_height="118dp"
33-
android:layout_toRightOf="@+id/mount_zao"
3434
android:scaleType="fitXY"
3535
/>
3636

@@ -39,25 +39,18 @@
3939
android:id="@+id/rainbow_bridge"
4040
android:layout_width="150dp"
4141
android:layout_height="118dp"
42-
android:layout_below="@+id/mount_zao"
43-
4442
android:scaleType="fitXY"
4543
/>
4644

4745
<ImageView
4846
android:src="@drawable/tulip"
4947
android:id="@+id/tulip"
50-
5148
android:layout_width="150dp"
5249
android:layout_height="118dp"
53-
android:layout_toRightOf="@+id/rainbow_bridge"
54-
55-
56-
android:layout_below="@+id/llamas"
5750
android:scaleType="fitXY"
5851
/>
5952

60-
</RelativeLayout>
53+
</GridLayout>
6154

6255

6356
<LinearLayout android:orientation="vertical"

app/src/main/res/layout/welcome_do_upload.xml

+5-12
< 697F /tr>
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
android:weightSum="1"
1010
android:layout_centerHorizontal="true">
1111

12-
<RelativeLayout
13-
android:gravity="center"
14-
android:layout_width="match_parent"
12+
<GridLayout
13+
android:layout_width="wrap_content"
1514
android:layout_height="240dp"
15+
android:layout_gravity="center_horizontal"
1616
android:layout_marginLeft="10dp"
1717
android:layout_marginRight="10dp"
18+
android:columnCount="2"
1819
>
1920

2021
<ImageView
@@ -30,7 +31,6 @@
3031
android:id="@+id/llamas"
3132
android:layout_width="150dp"
3233
android:layout_height="118dp"
33-
android:layout_toRightOf="@+id/mount_zao"
3434
android:scaleType="fitXY"
3535
/>
3636

@@ -39,25 +39,18 @@
3939
android:id="@+id/rainbow_bridge"
4040
android:layout_width="150dp"
4141
android:layout_height="118dp"
42-
android:layout_below="@+id/mount_zao"
43-
4442
android:scaleType="fitXY"
4543
/>
4644

4745
<ImageView
4846
android:src="@drawable/tulip"
4947
android:id="@+id/tulip"
50-
5148
android:layout_width="150dp"
5249
android:layout_height="118dp"
53-
android:layout_toRightOf="@+id/rainbow_bridge"
54-
55-
56-
android:layout_below="@+id/llamas"
5750
android:scaleType="fitXY"
5851
/>
5952

60-
</RelativeLayout>
53+
</GridLayout>
6154

6255
<TextView
6356
android:layout_width="295dp"

0 commit comments

Comments
 (0)