]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Show selected user identity in profile list
authorTobias Brunner <tobias@strongswan.org>
Sat, 30 Apr 2016 15:14:34 +0000 (17:14 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 2 May 2016 16:39:19 +0000 (18:39 +0200)
This also readds the colons that were removed from the labels.

src/frontends/android/app/src/main/java/org/strongswan/android/ui/adapter/VpnProfileAdapter.java

index f3bb271bc2dc64a8624253ec1f9a0fba7a7c4f43..58296a018c091b765e5c10cffcb0c9161ec8f967 100644 (file)
@@ -63,12 +63,18 @@ public class VpnProfileAdapter extends ArrayAdapter<VpnProfile>
                TextView tv = (TextView)vpnProfileView.findViewById(R.id.profile_item_name);
                tv.setText(profile.getName());
                tv = (TextView)vpnProfileView.findViewById(R.id.profile_item_gateway);
-               tv.setText(getContext().getString(R.string.profile_gateway_label) + " " + profile.getGateway());
+               tv.setText(getContext().getString(R.string.profile_gateway_label) + ": " + profile.getGateway());
                tv = (TextView)vpnProfileView.findViewById(R.id.profile_item_username);
                if (profile.getVpnType().has(VpnTypeFeature.USER_PASS))
                {       /* 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());
+                       tv.setText(getContext().getString(R.string.profile_username_label) + ": " + profile.getUsername());
+               }
+               else if (profile.getVpnType().has(VpnTypeFeature.CERTIFICATE) &&
+                                profile.getLocalId() != null)
+               {
+                       tv.setVisibility(View.VISIBLE);
+                       tv.setText(getContext().getString(R.string.profile_user_select_id_label) + ": " + profile.getLocalId());
                }
                else
                {
@@ -77,7 +83,7 @@ public class VpnProfileAdapter extends ArrayAdapter<VpnProfile>
                tv = (TextView)vpnProfileView.findViewById(R.id.profile_item_certificate);
                if (profile.getVpnType().has(VpnTypeFeature.CERTIFICATE))
                {
-                       tv.setText(getContext().getString(R.string.profile_user_certificate_label) + " " + profile.getUserCertificateAlias());
+                       tv.setText(getContext().getString(R.string.profile_user_certificate_label) + ": " + profile.getUserCertificateAlias());
                        tv.setVisibility(View.VISIBLE);
                }
                else