Skip to content

Commit 9d1c183

Browse files
Chia-chi YehAndroid (Google) Code Review
authored andcommitted
Merge "VpnDialogs: revise UI layout."
2 parents 84da4e4 + 72fddaa commit 9d1c183

File tree

2 files changed

+43
-44
lines changed

2 files changed

+43
-44
lines changed

packages/VpnDialogs/res/layout/confirm.xml

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,43 @@
1515
limitations under the License.
1616
-->
1717

18-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
19-
android:layout_width="wrap_content"
20-
android:layout_height="wrap_content"
21-
android:padding="3mm">
22-
23-
<ImageView android:id="@+id/icon"
24-
android:layout_width="@android:dimen/app_icon_size"
25-
android:layout_height="@android:dimen/app_icon_size"
26-
android:layout_alignParentTop="true"
27-
android:layout_alignParentLeft="true"
28-
android:layout_marginRight="1mm"/>
29-
30-
<TextView android:id="@+id/warning"
31-
android:layout_width="fill_parent"
18+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content">
21+
<LinearLayout android:layout_width="match_parent"
3222
android:layout_height="wrap_content"
33-
android:layout_alignParentLeft="true"
34-
android:layout_alignParentRight="true"
35-
android:layout_below="@id/icon"
36-
android:padding="3mm"
37-
android:text="@string/warning"
38-
android:textSize="18sp"/>
39-
40-
<TextView android:id="@+id/prompt"
41-
android:layout_width="fill_parent"
42-
android:layout_height="wrap_content"
43-
android:layout_alignParentTop="true"
44-
android:layout_alignParentRight="true"
45-
android:layout_toRightOf="@id/icon"
46-
android:layout_above="@id/warning"
47-
android:gravity="center_vertical"
48-
android:textSize="20sp"/>
49-
50-
<CheckBox android:id="@+id/check"
51-
android:layout_width="fill_parent"
52-
android:layout_height="wrap_content"
53-
android:layout_alignParentLeft="true"
54-
android:layout_alignParentRight="true"
55-
android:layout_below="@id/warning"
56-
android:text="@string/accept"
57-
android:textSize="20sp"
58-
android:checked="false"/>
59-
60-
</RelativeLayout>
23+
android:orientation="vertical"
24+
android:padding="3mm">
25+
26+
<LinearLayout android:layout_width="match_parent"
27+
android:layout_height="wrap_content"
28+
android:orientation="horizontal"
29+
android:gravity="center_vertical">
30+
31+
<ImageView android:id="@+id/icon"
32+
android:layout_width="@android:dimen/app_icon_size"
33+
android:layout_height="@android:dimen/app_icon_size"
34+
android:paddingRight="1mm"/>
35+
36+
<TextView android:id="@+id/prompt"
37+
android:layout_width="fill_parent"
38+
android:layout_height="wrap_content"
39+
android:textSize="18sp"/>
40+
</LinearLayout>
41+
42+
<TextView android:id="@+id/warning"
43+
android:layout_width="fill_parent"
44+
android:layout_height="wrap_content"
45+
android:paddingTop="1mm"
46+
android:paddingBottom="1mm"
47+
android:text="@string/warning"
48+
android:textSize="18sp"/>
49+
50+
<CheckBox android:id="@+id/check"
51+
android:layout_width="fill_parent"
52+
android:layout_height="wrap_content"
53+
android:text="@string/accept"
54+
android:textSize="20sp"
55+
android:checked="false"/>
56+
</LinearLayout>
57+
</ScrollView>

packages/VpnDialogs/src/com/android/vpndialogs/ManageDialog.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ private String[] getStatistics() {
181181
String line = in.readLine().trim();
182182
if (line.startsWith(prefix)) {
183183
String[] numbers = line.substring(prefix.length()).split(" +");
184-
if (numbers.length == 17) {
185-
return numbers;
184+
for (int i = 1; i < 17; ++i) {
185+
if (!numbers[i].equals("0")) {
186+
return numbers;
187+
}
186188
}
187189
break;
188190
}

0 commit comments

Comments
 (0)