VpnDialogs: revise UI layout.

Also hide statistics when they are not available.

Bug: 5372746
Change-Id: Iceffc8732cd51461630127f4fd17d505bc8b05aa
This commit is contained in:
Chia-chi Yeh
2011-09-26 15:05:52 -07:00
parent e690f565fd
commit 72fddaa5d9
2 changed files with 40 additions and 41 deletions

View File

@@ -15,46 +15,43 @@
limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3mm">
<ImageView android:id="@+id/icon"
android:layout_width="@android:dimen/app_icon_size"
android:layout_height="@android:dimen/app_icon_size"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginRight="1mm"/>
<TextView android:id="@+id/warning"
android:layout_width="fill_parent"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@id/icon"
android:padding="3mm"
android:text="@string/warning"
android:textSize="18sp"/>
android:orientation="vertical"
android:padding="3mm">
<TextView android:id="@+id/prompt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/icon"
android:layout_above="@id/warning"
android:gravity="center_vertical"
android:textSize="20sp"/>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<CheckBox android:id="@+id/check"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@id/warning"
android:text="@string/accept"
android:textSize="20sp"
android:checked="false"/>
<ImageView android:id="@+id/icon"
android:layout_width="@android:dimen/app_icon_size"
android:layout_height="@android:dimen/app_icon_size"
android:paddingRight="1mm"/>
</RelativeLayout>
<TextView android:id="@+id/prompt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18sp"/>
</LinearLayout>
<TextView android:id="@+id/warning"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="1mm"
android:paddingBottom="1mm"
android:text="@string/warning"
android:textSize="18sp"/>
<CheckBox android:id="@+id/check"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/accept"
android:textSize="20sp"
android:checked="false"/>
</LinearLayout>
</ScrollView>

View File

@@ -181,8 +181,10 @@ public class ManageDialog extends Activity implements Handler.Callback,
String line = in.readLine().trim();
if (line.startsWith(prefix)) {
String[] numbers = line.substring(prefix.length()).split(" +");
if (numbers.length == 17) {
return numbers;
for (int i = 1; i < 17; ++i) {
if (!numbers[i].equals("0")) {
return numbers;
}
}
break;
}