android: Add fragment that displays the IMC state

The fragment hides itself if the state is unknown or the assessment
succeeded.
This commit is contained in:
Tobias Brunner
2013-07-08 18:49:29 +02:00
parent a05acd7629
commit e5bf6dcddc
9 changed files with 210 additions and 7 deletions
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Tobias Brunner
Hochschule fuer Technik Rapperswil
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/vpn_state_background"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:text="@string/imc_state_label"
android:textColor="?android:textColorPrimary"
android:textSize="20sp" />
<TextView
android:id="@+id/imc_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="?android:textColorSecondary"
android:textSize="20sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="?android:attr/listDivider" />
</LinearLayout>
+7 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Tobias Brunner
Copyright (C) 2012-2013 Tobias Brunner
Hochschule fuer Technik Rapperswil
This program is free software; you can redistribute it and/or modify it
@@ -24,6 +24,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<fragment
class="org.strongswan.android.ui.ImcStateFragment"
android:id="@+id/imc_state_frag"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<fragment
class="org.strongswan.android.ui.VpnProfileListFragment"
android:id="@+id/profile_list_frag"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Tobias Brunner
Copyright (C) 2012-2013 Tobias Brunner
Copyright (C) 2012 Giuliano Grassi
Copyright (C) 2012 Ralf Sager
Hochschule fuer Technik Rapperswil
@@ -86,6 +86,11 @@
<string name="state_disabled">Kein aktives Profil</string>
<string name="state_error">Fehler</string>
<!-- IMC state fragment -->
<string name="imc_state_label">Assessment:</string>
<string name="imc_state_isolate">Eingeschränkt</string>
<string name="imc_state_block">Fehlgeschlagen</string>
<!-- Dialogs -->
<string name="login_title">Passwort eingeben um zu verbinden</string>
<string name="login_confirm">Verbinden</string>
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Giuliano Grassi
Copyright (C) 2012 Ralf Sager
Copyright (C) 2012 Andreas Steffen
HSR Hochschule fuer Technik Rapperswil
@@ -88,6 +86,11 @@
<string name="state_disabled">Brak aktywnego VPN</string>
<string name="state_error">Błąd</string>
<!-- IMC state fragment -->
<string name="imc_state_label">Assessment:</string>
<string name="imc_state_isolate">Restricted</string>
<string name="imc_state_block">Failed</string>
<!-- Dialogs -->
<string name="login_title">Wprowadż hasło</string>
<string name="login_confirm">Połącz</string>
@@ -83,6 +83,11 @@
<string name="state_disabled">Нет активных VPN</string>
<string name="state_error">Ошибка</string>
<!-- IMC state fragment -->
<string name="imc_state_label">Assessment:</string>
<string name="imc_state_isolate">Restricted</string>
<string name="imc_state_block">Failed</string>
<!-- Dialogs -->
<string name="login_title">Введите пароль для соединения</string>
<string name="login_confirm">Соединить</string>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Dmitry Korzhevin
Copyright (C) 2013 Pavel Kopchyk
Copyright (C) 2012 Dmitry Korzhevin
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -84,6 +84,11 @@
<string name="state_disabled">Немає активних VPN</string>
<string name="state_error">Помилка</string>
<!-- IMC state fragment -->
<string name="imc_state_label">Assessment:</string>
<string name="imc_state_isolate">Restricted</string>
<string name="imc_state_block">Failed</string>
<!-- Dialogs -->
<string name="login_title">Введіть пароль для з\'єднання</string>
<string name="login_confirm">Підключити</string>
+4 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Tobias Brunner
Copyright (C) 2012-2013 Tobias Brunner
Hochschule fuer Technik Rapperswil
This program is free software; you can redistribute it and/or modify it
@@ -18,6 +18,9 @@
<color
name="error_text">#D9192C</color>
<color
name="warning_text">#FF9909</color>
<color
name="success_text">#99CC00</color>
+6 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 Tobias Brunner
Copyright (C) 2012-2013 Tobias Brunner
Copyright (C) 2012 Giuliano Grassi
Copyright (C) 2012 Ralf Sager
Hochschule fuer Technik Rapperswil
@@ -86,6 +86,11 @@
<string name="state_disabled">No active VPN</string>
<string name="state_error">Error</string>
<!-- IMC state fragment -->
<string name="imc_state_label">Assessment:</string>
<string name="imc_state_isolate">Restricted</string>
<string name="imc_state_block">Failed</string>
<!-- Dialogs -->
<string name="login_title">Enter password to connect</string>
<string name="login_confirm">Connect</string>