Skip to content

Commit 41d00da

Browse files
committed
Wrap items in TableLayout
1 parent 983b04f commit 41d00da

2 files changed

Lines changed: 65 additions & 1 deletion

File tree

MvvmDemo/README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= MvvmDemo
22

3-
This is a simple app just to demonstrate the use of the MVVM Design Pattern.
3+
This is a simple "signup/login" app just to demonstrate the use of the MVVM Design Pattern.
44
If you're familiar with MVC or MVP, that's a step in the right direction.
55
MVVM is so-called since it uses a Model, a View, and a ViewModel.
66

MvvmDemo/app/src/main/res/layout/activity_main.xml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@
2727
android:gravity="center_horizontal"
2828
/>
2929

30+
<TableLayout
31+
android:layout_width="wrap_content"
32+
android:layout_height="match_parent"
33+
android:layout_alignParentRight="true"
34+
android:layout_alignParentEnd="true"
35+
android:stretchColumns="0,1">
36+
37+
<TableRow
38+
android:layout_width="match_parent"
39+
android:layout_height="match_parent">
40+
android:paddingBottom="8dp"
41+
<TextView
42+
android:layout_width="match_parent"
43+
android:layout_height="wrap_content"
44+
android:text="LABEL"/>
45+
3046
<EditText
3147
android:id="@+id/inFirstName"
3248
android:layout_width="match_parent"
@@ -40,6 +56,16 @@
4056
android:singleLine="true"
4157
android:text="@={viewModel.firstName}" />
4258

59+
</TableRow>
60+
<TableRow
61+
android:layout_width="match_parent"
62+
android:layout_height="match_parent">
63+
android:paddingBottom="8dp"
64+
<TextView
65+
android:layout_width="match_parent"
66+
android:layout_height="wrap_content"
67+
android:text="LABEL"/>
68+
4369
<EditText
4470
android:id="@+id/inLastName"
4571
android:layout_width="match_parent"
@@ -52,6 +78,15 @@
5278
android:padding="8dp"
5379
android:text="@={viewModel.lastName}" />
5480

81+
</TableRow>
82+
<TableRow
83+
android:layout_width="match_parent"
84+
android:layout_height="match_parent">
85+
android:paddingBottom="8dp"
86+
<TextView
87+
android:layout_width="match_parent"
88+
android:layout_height="wrap_content"
89+
android:text="LABEL"/>
5590
<EditText
5691
android:id="@+id/inEmail"
5792
android:layout_width="match_parent"
@@ -64,6 +99,15 @@
6499
android:padding="8dp"
65100
android:text="@={viewModel.email}" />
66101

102+
</TableRow>
103+
<TableRow
104+
android:layout_width="match_parent"
105+
android:layout_height="match_parent">
106+
android:paddingBottom="8dp"
107+
<TextView
108+
android:layout_width="match_parent"
109+
android:layout_height="wrap_content"
110+
android:text="LABEL"/>
67111
<EditText
68112
android:id="@+id/inUserName"
69113
android:layout_width="match_parent"
@@ -75,6 +119,15 @@
75119
android:inputType="text"
76120
android:padding="8dp"
77121
android:text="@={viewModel.userName}" />
122+
</TableRow>
123+
<TableRow
124+
android:layout_width="match_parent"
125+
android:layout_height="match_parent">
126+
android:paddingBottom="8dp"
127+
<TextView
128+
android:layout_width="match_parent"
129+
android:layout_height="wrap_content"
130+
android:text="LABEL"/>
78131

79132
<EditText
80133
android:id="@+id/inPassword"
@@ -87,6 +140,15 @@
87140
android:inputType="textPassword"
88141
android:padding="8dp"
89142
android:text="@={viewModel.password}" />
143+
</TableRow>
144+
<TableRow
145+
android:layout_width="match_parent"
146+
android:layout_height="match_parent">
147+
android:paddingBottom="8dp"
148+
<TextView
149+
android:layout_width="match_parent"
150+
android:layout_height="wrap_content"
151+
android:text="LABEL"/>
90152

91153
<EditText
92154
android:id="@+id/inCountry"
@@ -98,6 +160,8 @@
98160
android:inputType="textCapWords"
99161
android:padding="8dp"
100162
android:text="@={viewModel.country}" />
163+
</TableRow>
164+
</TableLayout>
101165

102166
<CheckBox
103167
android:layout_width="match_parent"

0 commit comments

Comments
 (0)