aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2012-08-28 14:47:00 +0200
committerTobias Brunner <tobias@strongswan.org>2012-08-31 18:24:45 +0200
commit6de38fe88aac4706dd9f2b7377695e4ae8c5d6bd (patch)
tree7ce71e0cedf16f46702e9fa180e85e4f302475ce /src
parentf46da851ab51a1b6ef6b9817f49a866fb25e1c09 (diff)
downloadstrongswan-6de38fe88aac4706dd9f2b7377695e4ae8c5d6bd.tar.bz2
strongswan-6de38fe88aac4706dd9f2b7377695e4ae8c5d6bd.tar.xz
android: Display the selected certificate alias in the profile list
Diffstat (limited to 'src')
-rw-r--r--src/frontends/android/res/layout/profile_list_item.xml10
-rw-r--r--src/frontends/android/src/org/strongswan/android/ui/adapter/VpnProfileAdapter.java20
2 files changed, 29 insertions, 1 deletions
diff --git a/src/frontends/android/res/layout/profile_list_item.xml b/src/frontends/android/res/layout/profile_list_item.xml
index f55c8357a..93df7b649 100644
--- a/src/frontends/android/res/layout/profile_list_item.xml
+++ b/src/frontends/android/res/layout/profile_list_item.xml
@@ -46,4 +46,14 @@
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_marginLeft="15dp" />
+ <TextView
+ android:id="@+id/profile_item_certificate"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="?android:textColorSecondary"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:layout_marginLeft="15dp" />
+
</LinearLayout>
diff --git a/src/frontends/android/src/org/strongswan/android/ui/adapter/VpnProfileAdapter.java b/src/frontends/android/src/org/strongswan/android/ui/adapter/VpnProfileAdapter.java
index 39e3e586a..85dc8370a 100644
--- a/src/frontends/android/src/org/strongswan/android/ui/adapter/VpnProfileAdapter.java
+++ b/src/frontends/android/src/org/strongswan/android/ui/adapter/VpnProfileAdapter.java
@@ -64,7 +64,25 @@ public class VpnProfileAdapter extends ArrayAdapter<VpnProfile>
tv = (TextView)vpnProfileView.findViewById(R.id.profile_item_gateway);
tv.setText(getContext().getString(R.string.profile_gateway_label) + " " + profile.getGateway());
tv = (TextView)vpnProfileView.findViewById(R.id.profile_item_username);
- tv.setText(getContext().getString(R.string.profile_username_label) + " " + profile.getUsername());
+ if (profile.getVpnType().getRequiresUsernamePassword())
+ { /* if the view is reused we make sure it is visible */
+ tv.setVisibility(View.VISIBLE);
+ tv.setText(getContext().getString(R.string.profile_username_label) + " " + profile.getUsername());
+ }
+ else
+ {
+ tv.setVisibility(View.GONE);
+ }
+ tv = (TextView)vpnProfileView.findViewById(R.id.profile_item_certificate);
+ if (profile.getVpnType().getRequiresCertificate())
+ {
+ tv.setText(getContext().getString(R.string.profile_user_certificate_label) + " " + profile.getUserCertificateAlias());
+ tv.setVisibility(View.VISIBLE);
+ }
+ else
+ {
+ tv.setVisibility(View.GONE);
+ }
return vpnProfileView;
}