Skip to content

Commit cd6df64

Browse files
committed
ui(wolpi#387): refactor ui for better readability
- left align items - add tools:text to layout files for better development - sort ips so IPv4 ips are on top
1 parent 03acfd3 commit cd6df64

File tree

7 files changed

+112
-134
lines changed

7 files changed

+112
-134
lines changed

primitiveFTPd/res/layout/block_client_action.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
android:id="@+id/clientActionsLabel"
66
android:layout_width="wrap_content"
77
android:layout_height="wrap_content"
8-
android:layout_gravity="center_horizontal"
98
android:textStyle="bold"
109
android:layout_marginTop="16dp"
1110
android:text="@string/clientActionsLabel"
@@ -16,22 +15,19 @@
1615
android:id="@+id/clientActionsLine1"
1716
android:layout_width="fill_parent"
1817
android:layout_height="wrap_content"
19-
android:gravity="center_horizontal"
2018
android:textIsSelectable="true"
2119
/>
2220
<TextView
2321
android:id="@+id/clientActionsLine2"
2422
android:layout_width="fill_parent"
2523
android:layout_height="wrap_content"
26-
android:gravity="center_horizontal"
2724
android:visibility="gone"
2825
android:textIsSelectable="true"
2926
/>
3027
<TextView
3128
android:id="@+id/clientActionsLine3"
3229
android:layout_width="fill_parent"
3330
android:layout_height="wrap_content"
34-
android:gravity="center_horizontal"
3531
android:visibility="gone"
3632
android:textIsSelectable="true"
3733
/>

primitiveFTPd/res/layout/block_connect_data.xml

Lines changed: 101 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,183 +1,171 @@
1-
<merge xmlns:android="http://schemas.android.com/apk/res/android">
2-
3-
<!-- QuickShare Info -->
4-
<TextView
5-
android:id="@+id/quickShareInfo"
6-
android:layout_width="fill_parent"
7-
android:layout_height="wrap_content"
8-
android:gravity="center_horizontal"
9-
android:textStyle="bold"
10-
android:layout_marginTop="16dp"
11-
android:focusable="false"
12-
/>
13-
14-
<!-- interfaces/addresses and ports info in 2 columns -->
1+
<merge xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
152
<LinearLayout
16-
android:layout_width="fill_parent"
3+
android:orientation="vertical"
4+
android:layout_width="match_parent"
175
android:layout_height="wrap_content"
18-
android:orientation="horizontal"
19-
android:baselineAligned="false">
6+
>
7+
<!-- QuickShare Info -->
8+
<TextView
9+
android:id="@+id/quickShareInfo"
10+
android:layout_width="fill_parent"
11+
android:layout_height="wrap_content"
12+
android:textStyle="bold"
13+
android:focusable="false"
14+
tools:text="Quick Share Info"
15+
/>
2016

21-
<!-- left column -->
17+
<!-- interfaces/addresses and ports info in 2 columns -->
2218
<LinearLayout
23-
android:layout_width="0dp"
24-
android:layout_height="fill_parent"
25-
android:layout_weight="1"
26-
android:orientation="vertical">
27-
28-
<!-- addresses / interfaces -->
29-
<TextView
30-
android:id="@+id/addressesLabel"
31-
android:layout_width="fill_parent"
32-
android:layout_height="wrap_content"
33-
android:gravity="center_horizontal"
34-
android:textStyle="bold"
35-
android:layout_marginTop="16dp"
36-
android:focusable="false"
37-
/>
19+
android:layout_width="fill_parent"
20+
android:layout_height="wrap_content"
21+
android:orientation="horizontal"
22+
android:layout_marginTop="16dp"
23+
android:baselineAligned="false">
3824

25+
<!-- left column -->
26+
<LinearLayout
27+
android:layout_width="0dp"
28+
android:layout_height="fill_parent"
29+
android:layout_weight="1"
30+
android:orientation="vertical">
31+
32+
<!-- addresses / interfaces -->
33+
<TextView
34+
android:id="@+id/addressesLabel"
35+
android:layout_width="fill_parent"
36+
android:layout_height="wrap_content"
37+
android:textStyle="bold"
38+
android:focusable="false"
39+
tools:text="IP Address (Network Interface)"
40+
/>
41+
42+
<LinearLayout
43+
android:id="@+id/addressesContainer"
44+
android:orientation="vertical"
45+
android:layout_width="wrap_content"
46+
android:layout_height="wrap_content"
47+
/>
48+
</LinearLayout>
49+
50+
<!-- right column -->
3951
<LinearLayout
40-
android:id="@+id/addressesContainer"
41-
android:orientation="vertical"
4252
android:layout_width="wrap_content"
43-
android:layout_height="wrap_content"
44-
android:layout_gravity="center_horizontal"
45-
/>
53+
android:layout_height="fill_parent"
54+
android:orientation="vertical">
55+
56+
<!-- ports -->
57+
<TextView
58+
android:id="@+id/portsLabel"
59+
android:layout_width="match_parent"
60+
android:layout_height="wrap_content"
61+
android:textStyle="bold"
62+
android:focusable="false"
63+
tools:text="Protocol / Port / State"
64+
/>
65+
<TextView
66+
android:id="@+id/ftpTextView"
67+
android:layout_width="match_parent"
68+
android:layout_height="wrap_content"
69+
android:textIsSelectable="true"
70+
android:focusable="false"
71+
tools:text="ftp / 2211 / Stopped"
72+
/>
73+
<TextView
74+
android:id="@+id/sftpTextView"
75+
android:layout_width="match_parent"
76+
android:layout_height="wrap_content"
77+
android:textIsSelectable="true"
78+
android:focusable="false"
79+
tools:text="sftp / 1234 / Stopped"
80+
/>
81+
</LinearLayout>
4682
</LinearLayout>
4783

48-
<!-- right column -->
84+
<!-- user name -->
4985
<LinearLayout
50-
android:layout_width="0dp"
51-
android:layout_height="fill_parent"
52-
android:layout_weight="1"
53-
android:orientation="vertical">
54-
55-
<!-- ports -->
86+
android:layout_height="wrap_content"
87+
android:layout_width="match_parent"
88+
android:orientation="horizontal"
89+
android:layout_marginTop="16dp"
90+
>
5691
<TextView
57-
android:id="@+id/portsLabel"
58-
android:layout_width="fill_parent"
92+
android:id="@+id/usernameLabel"
93+
android:layout_width="wrap_content"
5994
android:layout_height="wrap_content"
60-
android:gravity="center_horizontal"
6195
android:textStyle="bold"
62-
android:layout_marginTop="16dp"
63-
android:focusable="false"
64-
/>
65-
<TextView
66-
android:id="@+id/ftpTextView"
67-
android:layout_width="fill_parent"
68-
android:layout_height="wrap_content"
69-
android:gravity="center_horizontal"
70-
android:textIsSelectable="true"
96+
android:text="@string/prefTitleUser"
7197
android:focusable="false"
72-
/>
98+
/>
99+
73100
<TextView
74-
android:id="@+id/sftpTextView"
75-
android:layout_width="fill_parent"
101+
android:id="@+id/usernameTextView"
102+
android:layout_width="0dp"
103+
android:layout_weight="1"
76104
android:layout_height="wrap_content"
77-
android:gravity="center_horizontal"
105+
android:layout_marginStart="16dp"
106+
android:layout_marginEnd="16dp"
78107
android:textIsSelectable="true"
79108
android:focusable="false"
80-
/>
109+
tools:text="ftp_username"
110+
/>
81111
</LinearLayout>
82-
</LinearLayout>
83-
84-
<!-- user name -->
85-
<TextView
86-
android:id="@+id/usernameLabel"
87-
android:layout_width="fill_parent"
88-
android:layout_height="wrap_content"
89-
android:gravity="center_horizontal"
90-
android:textStyle="bold"
91-
android:layout_marginTop="16dp"
92-
android:text="@string/prefTitleUser"
93-
android:focusable="false"
94-
/>
95-
<TextView
96-
android:id="@+id/usernameTextView"
97-
android:layout_width="fill_parent"
98-
android:layout_height="wrap_content"
99-
android:gravity="center_horizontal"
100-
android:textIsSelectable="true"
101-
android:focusable="false"
102-
/>
103-
104-
<!-- login / auth / permission info in 2 columns -->
105-
<LinearLayout
106-
android:layout_width="fill_parent"
107-
android:layout_height="wrap_content"
108-
android:orientation="horizontal"
109-
android:baselineAligned="false"
110-
android:layout_marginTop="16dp"
111-
>
112112

113-
<!-- left column -->
113+
<!-- login / auth / permission info in 2 columns -->
114114
<LinearLayout
115-
android:layout_width="0dp"
116-
android:layout_height="fill_parent"
117-
android:layout_weight="1"
118-
android:orientation="vertical">
115+
android:layout_width="fill_parent"
116+
android:layout_height="wrap_content"
117+
android:orientation="vertical"
118+
android:baselineAligned="false"
119+
android:layout_marginTop="16dp"
120+
>
121+
119122

120123
<TextView
121124
android:id="@+id/anonymousLoginTextView"
122125
android:layout_width="fill_parent"
123126
android:layout_height="wrap_content"
124-
android:gravity="center_horizontal"
125127
android:focusable="false"
126-
/>
128+
/>
127129

128130
<TextView
129131
android:id="@+id/passwordPresentTextView"
130132
android:layout_width="fill_parent"
131133
android:layout_height="wrap_content"
132-
android:gravity="center_horizontal"
133134
android:focusable="false"
134135
/>
135136

136137
<TextView
137138
android:id="@+id/pubKeyAuthTextView"
138139
android:layout_width="fill_parent"
139140
android:layout_height="wrap_content"
140-
android:gravity="center_horizontal"
141141
android:focusable="false"
142142
/>
143-
</LinearLayout>
144-
145-
<!-- right column -->
146-
<LinearLayout
147-
android:layout_width="0dp"
148-
android:layout_height="fill_parent"
149-
android:layout_weight="2"
150-
android:orientation="vertical">
151143

152144
<TextView
153145
android:id="@+id/hasNormalStorageAccessTextView"
154146
android:layout_width="fill_parent"
155147
android:layout_height="wrap_content"
156-
android:gravity="center_horizontal"
157148
android:focusable="false"
158149
/>
159150

160151
<TextView
161152
android:id="@+id/hasFullStorageAccessTextView"
162153
android:layout_width="fill_parent"
163154
android:layout_height="wrap_content"
164-
android:gravity="center_horizontal"
165155
android:focusable="false"
166156
/>
167157

168158
<TextView
169159
android:id="@+id/hasMediaLocationAccessTextView"
170160
android:layout_width="fill_parent"
171161
android:layout_height="wrap_content"
172-
android:gravity="center_horizontal"
173162
android:focusable="false"
174163
/>
175164

176165
<TextView
177166
android:id="@+id/hasNotificationPermissionTextView"
178167
android:layout_width="fill_parent"
179168
android:layout_height="wrap_content"
180-
android:gravity="center_horizontal"
181169
android:focusable="false"
182170
/>
183171
</LinearLayout>

primitiveFTPd/res/layout/block_key_fingerprints.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
android:id="@+id/keyFingerprintsLabel"
66
android:layout_width="wrap_content"
77
android:layout_height="wrap_content"
8-
android:layout_gravity="center_horizontal"
98
android:textStyle="bold"
109
android:layout_marginTop="16dp"
1110
android:text="@string/fingerprintsLabel"
@@ -25,7 +24,6 @@
2524
android:id="@+id/allKeysFingerprintsLabel"
2625
android:layout_width="wrap_content"
2726
android:layout_height="wrap_content"
28-
android:layout_gravity="center_horizontal"
2927
android:layout_marginTop="16dp"
3028
android:layout_marginBottom="16dp"
3129
android:text="@string/allKeysFingerprintsLabel"
@@ -44,14 +42,12 @@
4442
android:id="@+id/keyFingerprintMd5Label"
4543
android:layout_width="fill_parent"
4644
android:layout_height="wrap_content"
47-
android:gravity="center_horizontal"
4845
android:focusable="false"
4946
/>
5047
<TextView
5148
android:id="@+id/keyFingerprintMd5TextView"
5249
android:layout_width="fill_parent"
5350
android:layout_height="wrap_content"
54-
android:gravity="center_horizontal"
5551
android:typeface="monospace"
5652
android:textIsSelectable="true"
5753
android:selectAllOnFocus="true"
@@ -62,15 +58,13 @@
6258
android:id="@+id/keyFingerprintSha1Label"
6359
android:layout_width="fill_parent"
6460
android:layout_height="wrap_content"
65-
android:gravity="center_horizontal"
6661
android:layout_marginTop="8dp"
6762
android:focusable="false"
6863
/>
6964
<TextView
7065
android:id="@+id/keyFingerprintSha1TextView"
7166
android:layout_width="fill_parent"
7267
android:layout_height="wrap_content"
73-
android:gravity="center_horizontal"
7468
android:typeface="monospace"
7569
android:textIsSelectable="true"
7670
android:selectAllOnFocus="true"
@@ -81,15 +75,13 @@
8175
android:id="@+id/keyFingerprintSha256Label"
8276
android:layout_width="fill_parent"
8377
android:layout_height="wrap_content"
84-
android:gravity="center_horizontal"
8578
android:layout_marginTop="8dp"
8679
android:focusable="false"
8780
/>
8881
<TextView
8982
android:id="@+id/keyFingerprintSha256TextView"
9083
android:layout_width="fill_parent"
9184
android:layout_height="wrap_content"
92-
android:gravity="center_horizontal"
9385
android:typeface="monospace"
9486
android:textIsSelectable="true"
9587
android:selectAllOnFocus="true"

0 commit comments

Comments
 (0)