Browse Source

add scroll for home page

ilhamitubagoes 4 years ago
parent
commit
800a3fbfbd
1 changed files with 209 additions and 202 deletions
  1. 209 202
      app/src/main/res/layout/activity_home.xml

+ 209 - 202
app/src/main/res/layout/activity_home.xml

@@ -17,241 +17,248 @@
17 17
             android:layout_width="match_parent"
18 18
             android:layout_height="wrap_content">
19 19
 
20
-            <RelativeLayout
20
+            <ScrollView
21 21
                 android:layout_width="match_parent"
22 22
                 android:layout_height="wrap_content">
23 23
 
24
-                <LinearLayout
25
-                    android:id="@+id/ll_rfid_user"
26
-                    android:layout_marginStart="16dp"
27
-                    android:layout_marginTop="24dp"
24
+                <RelativeLayout
28 25
                     android:layout_width="match_parent"
29
-                    android:layout_height="wrap_content"
30
-                    android:orientation="horizontal">
26
+                    android:layout_height="wrap_content">
31 27
 
32
-                    <TextView
33
-                        android:textSize="14sp"
34
-                        android:textColor="@color/colorBlack"
35
-                        android:layout_width="230dp"
28
+                    <LinearLayout
29
+                        android:id="@+id/ll_rfid_user"
30
+                        android:layout_marginStart="16dp"
31
+                        android:layout_marginTop="24dp"
32
+                        android:layout_width="match_parent"
36 33
                         android:layout_height="wrap_content"
37
-                        android:layout_marginEnd="2dp"
38
-                        android:layout_marginLeft="2dp"
39
-                        android:layout_marginRight="2dp"
40
-                        android:layout_weight="1"
41
-                        android:textStyle="bold"
42
-                        android:text="@string/label_number_rfid" />
34
+                        android:orientation="horizontal">
35
+
36
+                        <TextView
37
+                            android:textSize="14sp"
38
+                            android:textColor="@color/colorBlack"
39
+                            android:layout_width="230dp"
40
+                            android:layout_height="wrap_content"
41
+                            android:layout_marginEnd="2dp"
42
+                            android:layout_marginLeft="2dp"
43
+                            android:layout_marginRight="2dp"
44
+                            android:layout_weight="1"
45
+                            android:textStyle="bold"
46
+                            android:text="@string/label_number_rfid" />
47
+
48
+                        <TextView
49
+                            android:id="@+id/tv_rfid_gun_id"
50
+                            android:layout_width="match_parent"
51
+                            android:layout_height="wrap_content"
52
+                            android:layout_marginStart="12dp"
53
+                            android:layout_weight="1"
54
+                            android:textSize="14sp"
55
+                            android:textColor="@color/colorBlack"
56
+                            tools:text="RFID-AN70-N650" />
57
+                    </LinearLayout>
43 58
 
44
-                    <TextView
45
-                        android:id="@+id/tv_rfid_gun_id"
59
+                    <LinearLayout
60
+                        android:id="@+id/ll_rfid_card"
61
+                        android:layout_marginStart="16dp"
62
+                        android:layout_marginTop="12dp"
46 63
                         android:layout_width="match_parent"
47 64
                         android:layout_height="wrap_content"
48
-                        android:layout_marginStart="12dp"
49
-                        android:layout_weight="1"
50
-                        android:textSize="14sp"
51
-                        android:textColor="@color/colorBlack"
52
-                        tools:text="RFID-AN70-N650" />
53
-                </LinearLayout>
65
+                        android:layout_below="@+id/ll_rfid_user"
66
+                        android:orientation="horizontal">
67
+                        <TextView
68
+                            android:textSize="14sp"
69
+                            android:textColor="@color/colorBlack"
70
+                            android:layout_width="230dp"
71
+                            android:layout_height="wrap_content"
72
+                            android:layout_marginEnd="2dp"
73
+                            android:layout_marginLeft="2dp"
74
+                            android:layout_marginRight="2dp"
75
+                            android:layout_weight="1"
76
+                            android:textStyle="bold"
77
+                            android:text="@string/label_number_rfid_card" />
54 78
 
55
-                <LinearLayout
56
-                    android:id="@+id/ll_rfid_card"
57
-                    android:layout_marginStart="16dp"
58
-                    android:layout_marginTop="12dp"
59
-                    android:layout_width="match_parent"
60
-                    android:layout_height="wrap_content"
61
-                    android:layout_below="@+id/ll_rfid_user"
62
-                    android:orientation="horizontal">
63
-                    <TextView
64
-                        android:textSize="14sp"
65
-                        android:textColor="@color/colorBlack"
66
-                        android:layout_width="230dp"
67
-                        android:layout_height="wrap_content"
68
-                        android:layout_marginEnd="2dp"
69
-                        android:layout_marginLeft="2dp"
70
-                        android:layout_marginRight="2dp"
71
-                        android:layout_weight="1"
72
-                        android:textStyle="bold"
73
-                        android:text="@string/label_number_rfid_card" />
79
+                        <TextView
80
+                            android:id="@+id/tv_rfid_card_number"
81
+                            android:layout_width="match_parent"
82
+                            android:layout_height="wrap_content"
83
+                            android:layout_weight="1"
84
+                            android:layout_marginStart="12dp"
85
+                            android:textSize="14sp"
86
+                            android:textColor="@color/colorBlack"
87
+                            tools:text="0009449244" />
88
+                    </LinearLayout>
74 89
 
75
-                    <TextView
76
-                        android:id="@+id/tv_rfid_card_number"
90
+                    <LinearLayout
91
+                        android:id="@+id/ll_employee"
92
+                        android:layout_marginStart="16dp"
93
+                        android:layout_marginTop="12dp"
77 94
                         android:layout_width="match_parent"
78 95
                         android:layout_height="wrap_content"
79
-                        android:layout_weight="1"
80
-                        android:layout_marginStart="12dp"
81
-                        android:textSize="14sp"
82
-                        android:textColor="@color/colorBlack"
83
-                        tools:text="0009449244" />
84
-                </LinearLayout>
96
+                        android:layout_below="@+id/ll_rfid_card"
97
+                        android:orientation="horizontal">
98
+                        <TextView
99
+                            android:textSize="14sp"
100
+                            android:textColor="@color/colorBlack"
101
+                            android:layout_width="230dp"
102
+                            android:layout_height="wrap_content"
103
+                            android:layout_marginEnd="2dp"
104
+                            android:layout_marginLeft="2dp"
105
+                            android:layout_marginRight="2dp"
106
+                            android:layout_weight="1"
107
+                            android:textStyle="bold"
108
+                            android:text="@string/label_employee_name" />
85 109
 
86
-                <LinearLayout
87
-                    android:id="@+id/ll_employee"
88
-                    android:layout_marginStart="16dp"
89
-                    android:layout_marginTop="12dp"
90
-                    android:layout_width="match_parent"
91
-                    android:layout_height="wrap_content"
92
-                    android:layout_below="@+id/ll_rfid_card"
93
-                    android:orientation="horizontal">
94
-                    <TextView
95
-                        android:textSize="14sp"
96
-                        android:textColor="@color/colorBlack"
97
-                        android:layout_width="230dp"
98
-                        android:layout_height="wrap_content"
99
-                        android:layout_marginEnd="2dp"
100
-                        android:layout_marginLeft="2dp"
101
-                        android:layout_marginRight="2dp"
102
-                        android:layout_weight="1"
103
-                        android:textStyle="bold"
104
-                        android:text="@string/label_employee_name" />
110
+                        <TextView
111
+                            android:id="@+id/tv_employee_name"
112
+                            android:layout_width="match_parent"
113
+                            android:layout_height="wrap_content"
114
+                            android:layout_weight="1"
115
+                            android:layout_marginStart="12dp"
116
+                            android:textSize="14sp"
117
+                            android:textColor="@color/colorBlack"
118
+                            tools:text="Deddy Corbuzier" />
119
+                    </LinearLayout>
105 120
 
106
-                    <TextView
107
-                        android:id="@+id/tv_employee_name"
121
+                    <LinearLayout
122
+                        android:id="@+id/ll_gate"
123
+                        android:layout_marginStart="16dp"
124
+                        android:layout_marginTop="12dp"
108 125
                         android:layout_width="match_parent"
109 126
                         android:layout_height="wrap_content"
110
-                        android:layout_weight="1"
111
-                        android:layout_marginStart="12dp"
112
-                        android:textSize="14sp"
113
-                        android:textColor="@color/colorBlack"
114
-                        tools:text="Deddy Corbuzier" />
115
-                </LinearLayout>
127
+                        android:layout_below="@+id/ll_employee"
128
+                        android:orientation="horizontal">
129
+                        <TextView
130
+                            android:textSize="14sp"
131
+                            android:textColor="@color/colorBlack"
132
+                            android:layout_width="230dp"
133
+                            android:layout_height="wrap_content"
134
+                            android:layout_marginEnd="2dp"
135
+                            android:layout_marginLeft="2dp"
136
+                            android:layout_marginRight="2dp"
137
+                            android:layout_weight="1"
138
+                            android:textStyle="bold"
139
+                            android:text="@string/label_gate" />
116 140
 
117
-                <LinearLayout
118
-                    android:id="@+id/ll_gate"
119
-                    android:layout_marginStart="16dp"
120
-                    android:layout_marginTop="12dp"
121
-                    android:layout_width="match_parent"
122
-                    android:layout_height="wrap_content"
123
-                    android:layout_below="@+id/ll_employee"
124
-                    android:orientation="horizontal">
125
-                    <TextView
126
-                        android:textSize="14sp"
127
-                        android:textColor="@color/colorBlack"
128
-                        android:layout_width="230dp"
129
-                        android:layout_height="wrap_content"
130
-                        android:layout_marginEnd="2dp"
131
-                        android:layout_marginLeft="2dp"
132
-                        android:layout_marginRight="2dp"
133
-                        android:layout_weight="1"
134
-                        android:textStyle="bold"
135
-                        android:text="@string/label_gate" />
141
+                        <TextView
142
+                            android:id="@+id/tv_gate_name"
143
+                            android:layout_width="match_parent"
144
+                            android:layout_height="wrap_content"
145
+                            android:layout_weight="1"
146
+                            android:layout_marginStart="12dp"
147
+                            android:textSize="14sp"
148
+                            android:textColor="@color/colorBlack"
149
+                            android:text="@string/label_strip"
150
+                            tools:text="Crown Palace" />
151
+                    </LinearLayout>
136 152
 
137
-                    <TextView
138
-                        android:id="@+id/tv_gate_name"
153
+                    <LinearLayout
154
+                        android:id="@+id/ll_site"
155
+                        android:layout_marginStart="16dp"
156
+                        android:layout_marginTop="12dp"
139 157
                         android:layout_width="match_parent"
140 158
                         android:layout_height="wrap_content"
141
-                        android:layout_weight="1"
142
-                        android:layout_marginStart="12dp"
143
-                        android:textSize="14sp"
144
-                        android:textColor="@color/colorBlack"
145
-                        android:text="@string/label_strip"
146
-                        tools:text="Crown Palace" />
147
-                </LinearLayout>
159
+                        android:layout_below="@+id/ll_gate"
160
+                        android:orientation="horizontal">
161
+                        <TextView
162
+                            android:textSize="14sp"
163
+                            android:textColor="@color/colorBlack"
164
+                            android:layout_width="230dp"
165
+                            android:layout_height="wrap_content"
166
+                            android:layout_marginEnd="2dp"
167
+                            android:layout_marginLeft="2dp"
168
+                            android:layout_marginRight="2dp"
169
+                            android:layout_weight="1"
170
+                            android:textStyle="bold"
171
+                            android:text="@string/label_site" />
148 172
 
149
-                <LinearLayout
150
-                    android:id="@+id/ll_site"
151
-                    android:layout_marginStart="16dp"
152
-                    android:layout_marginTop="12dp"
153
-                    android:layout_width="match_parent"
154
-                    android:layout_height="wrap_content"
155
-                    android:layout_below="@+id/ll_gate"
156
-                    android:orientation="horizontal">
157
-                    <TextView
158
-                        android:textSize="14sp"
159
-                        android:textColor="@color/colorBlack"
160
-                        android:layout_width="230dp"
161
-                        android:layout_height="wrap_content"
162
-                        android:layout_marginEnd="2dp"
163
-                        android:layout_marginLeft="2dp"
164
-                        android:layout_marginRight="2dp"
165
-                        android:layout_weight="1"
166
-                        android:textStyle="bold"
167
-                        android:text="@string/label_site" />
173
+                        <androidx.recyclerview.widget.RecyclerView
174
+                            android:id="@+id/rv_site"
175
+                            android:layout_width="match_parent"
176
+                            android:layout_height="wrap_content"
177
+                            android:layout_weight="1"
178
+                            android:layout_marginStart="12dp"
179
+                            android:textSize="14sp"
180
+                            android:textColor="@color/colorBlack"
181
+                            tools:listitem="@layout/row_site"
182
+                            tools:itemCount="3"/>
183
+                    </LinearLayout>
168 184
 
169
-                    <androidx.recyclerview.widget.RecyclerView
170
-                        android:id="@+id/rv_site"
185
+                    <LinearLayout
186
+                        android:id="@+id/ll_permit"
187
+                        android:layout_marginStart="16dp"
188
+                        android:layout_marginTop="12dp"
171 189
                         android:layout_width="match_parent"
172 190
                         android:layout_height="wrap_content"
173
-                        android:layout_weight="1"
174
-                        android:layout_marginStart="12dp"
175
-                        android:textSize="14sp"
176
-                        android:textColor="@color/colorBlack"
177
-                        tools:listitem="@layout/row_site"
178
-                        tools:itemCount="3"/>
179
-                </LinearLayout>
191
+                        android:layout_below="@+id/ll_site"
192
+                        android:orientation="horizontal">
193
+                        <TextView
194
+                            android:textSize="14sp"
195
+                            android:textColor="@color/colorBlack"
196
+                            android:layout_width="0dp"
197
+                            android:layout_height="wrap_content"
198
+                            android:layout_marginEnd="2dp"
199
+                            android:layout_marginLeft="2dp"
200
+                            android:layout_marginRight="2dp"
201
+                            android:layout_weight="1"
202
+                            android:textStyle="bold"
203
+                            android:text="@string/label_entry_ermit" />
180 204
 
181
-                <LinearLayout
182
-                    android:id="@+id/ll_permit"
183
-                    android:layout_marginStart="16dp"
184
-                    android:layout_marginTop="12dp"
185
-                    android:layout_width="match_parent"
186
-                    android:layout_height="wrap_content"
187
-                    android:layout_below="@+id/ll_site"
188
-                    android:orientation="horizontal">
189
-                    <TextView
190
-                        android:textSize="14sp"
191
-                        android:textColor="@color/colorBlack"
192
-                        android:layout_width="0dp"
193
-                        android:layout_height="wrap_content"
194
-                        android:layout_marginEnd="2dp"
195
-                        android:layout_marginLeft="2dp"
196
-                        android:layout_marginRight="2dp"
197
-                        android:layout_weight="1"
198
-                        android:textStyle="bold"
199
-                        android:text="@string/label_entry_ermit" />
205
+                        <androidx.appcompat.widget.AppCompatSpinner
206
+                            android:id="@+id/spinner_permit"
207
+                            android:layout_width="165dp"
208
+                            android:layout_height="wrap_content"
209
+                            android:layout_marginStart="12dp"
210
+                            android:layout_marginEnd="12dp"
211
+                            style="@style/spinner_style" />
212
+                    </LinearLayout>
200 213
 
201
-                    <androidx.appcompat.widget.AppCompatSpinner
202
-                        android:id="@+id/spinner_permit"
203
-                        android:layout_width="165dp"
214
+                    <LinearLayout
215
+                        android:id="@+id/ll_status_scan"
216
+                        android:layout_marginStart="16dp"
217
+                        android:layout_marginTop="12dp"
218
+                        android:layout_width="match_parent"
204 219
                         android:layout_height="wrap_content"
205
-                        android:layout_marginStart="12dp"
206
-                        android:layout_marginEnd="12dp"
207
-                        style="@style/spinner_style" />
208
-                </LinearLayout>
220
+                        android:layout_below="@+id/ll_permit"
221
+                        android:orientation="horizontal">
222
+                        <TextView
223
+                            android:textSize="14sp"
224
+                            android:textColor="@color/colorBlack"
225
+                            android:layout_width="0dp"
226
+                            android:layout_height="wrap_content"
227
+                            android:layout_marginEnd="2dp"
228
+                            android:layout_marginLeft="2dp"
229
+                            android:layout_marginRight="2dp"
230
+                            android:layout_weight="1"
231
+                            android:textStyle="bold"
232
+                            android:text="@string/label_scan_status" />
209 233
 
210
-                <LinearLayout
211
-                    android:id="@+id/ll_status_scan"
212
-                    android:layout_marginStart="16dp"
213
-                    android:layout_marginTop="12dp"
214
-                    android:layout_width="match_parent"
215
-                    android:layout_height="wrap_content"
216
-                    android:layout_below="@+id/ll_permit"
217
-                    android:orientation="horizontal">
218
-                    <TextView
219
-                        android:textSize="14sp"
220
-                        android:textColor="@color/colorBlack"
221
-                        android:layout_width="0dp"
222
-                        android:layout_height="wrap_content"
223
-                        android:layout_marginEnd="2dp"
224
-                        android:layout_marginLeft="2dp"
225
-                        android:layout_marginRight="2dp"
226
-                        android:layout_weight="1"
227
-                        android:textStyle="bold"
228
-                        android:text="@string/label_scan_status" />
234
+                        <androidx.recyclerview.widget.RecyclerView
235
+                            android:id="@+id/rv_status_scan"
236
+                            android:layout_width="175dp"
237
+                            android:layout_height="wrap_content"
238
+                            android:layout_marginStart="12dp"
239
+                            android:layout_marginEnd="12dp"
240
+                            tools:listitem="@layout/row_status_scan"
241
+                            tools:itemCount="2"/>
229 242
 
230
-                    <androidx.recyclerview.widget.RecyclerView
231
-                        android:id="@+id/rv_status_scan"
232
-                        android:layout_width="175dp"
233
-                        android:layout_height="wrap_content"
234
-                        android:layout_marginStart="12dp"
235
-                        android:layout_marginEnd="12dp"
236
-                        tools:listitem="@layout/row_status_scan"
237
-                        tools:itemCount="2"/>
243
+                    </LinearLayout>
238 244
 
239
-                </LinearLayout>
245
+                    <Button
246
+                        android:id="@+id/btn_scan"
247
+                        style="@style/ButtonCommon"
248
+                        android:layout_width="match_parent"
249
+                        android:layout_height="wrap_content"
250
+                        android:layout_below="@+id/ll_status_scan"
251
+                        android:layout_alignParentStart="true"
252
+                        android:layout_alignParentEnd="true"
253
+                        android:layout_marginStart="16dp"
254
+                        android:layout_marginTop="24dp"
255
+                        android:layout_marginBottom="24dp"
256
+                        android:layout_marginEnd="16dp"
257
+                        android:text="@string/label_btn_scan" />
240 258
 
241
-                <Button
242
-                    android:id="@+id/btn_scan"
243
-                    style="@style/ButtonCommon"
244
-                    android:layout_width="match_parent"
245
-                    android:layout_height="wrap_content"
246
-                    android:layout_below="@+id/ll_status_scan"
247
-                    android:layout_alignParentStart="true"
248
-                    android:layout_alignParentEnd="true"
249
-                    android:layout_marginStart="16dp"
250
-                    android:layout_marginTop="24dp"
251
-                    android:layout_marginEnd="16dp"
252
-                    android:text="@string/label_btn_scan" />
259
+                </RelativeLayout>
253 260
 
254
-            </RelativeLayout>
261
+            </ScrollView>
255 262
 
256 263
         </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
257 264