vpnProfileView = inflater.inflate(resource, null);
}
VpnProfile profile = getItem(position);
- TextView tv = (TextView)vpnProfileView.findViewById(R.id.profile_item_name);
+ TextView tv = vpnProfileView.findViewById(R.id.profile_item_name);
tv.setText(profile.getName());
- tv = (TextView)vpnProfileView.findViewById(R.id.profile_item_gateway);
+ tv = vpnProfileView.findViewById(R.id.profile_item_managed);
+ tv.setVisibility(profile.isReadOnly() ? View.VISIBLE : View.GONE);
+ tv = 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 = 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.setVisibility(View.GONE);
}
- tv = (TextView)vpnProfileView.findViewById(R.id.profile_item_certificate);
+ tv = 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());
private void sortItems()
{
- Collections.sort(this.items, new Comparator<VpnProfile>() {
+ Collections.sort(this.items, new Comparator<VpnProfile>()
+ {
@Override
public int compare(VpnProfile lhs, VpnProfile rhs)
{
for more details.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:background="?android:attr/activatedBackgroundIndicator"
android:orientation="vertical"
android:paddingBottom="6dip"
- android:paddingTop="4dip"
- android:background="?android:attr/activatedBackgroundIndicator" >
+ android:paddingTop="4dip">
<TextView
android:id="@+id/profile_item_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="15dp"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:layout_marginStart="15dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ tools:text="Profile name" />
+
+ <TextView
+ android:id="@+id/profile_item_managed"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="15dp"
+ android:text="@string/profile_managed"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="@color/success_text"
+ android:visibility="gone"
+ tools:visibility="visible" />
<TextView
android:id="@+id/profile_item_gateway"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textColor="?android:textColorSecondary"
+ android:layout_marginStart="15dp"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:layout_marginLeft="15dp" />
+ android:textColor="?android:textColorSecondary"
+ tools:text="Server: vpn.example.com" />
<TextView
android:id="@+id/profile_item_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textColor="?android:textColorSecondary"
+ android:layout_marginStart="15dp"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:layout_marginLeft="15dp" />
+ android:textColor="?android:textColorSecondary"
+ tools:text="Username" />
<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:layout_marginStart="15dp"
android:ellipsize="end"
- android:layout_marginLeft="15dp" />
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:textColorSecondary"
+ tools:text="Certificate" />
</LinearLayout>
<string name="profile_cert_import">Zertifikat aus VPN Profil importieren</string>
<string name="profile_cert_alias">Zertifikat für \"%1$s\"</string>
<string name="profile_profile_id">Profil-ID</string>
+ <string name="profile_managed">Verwaltetes Profil</string>
<!-- Warnings/Notifications in the details view -->
<string name="alert_text_no_input_gateway">Ein Wert wird benötigt, um die Verbindung aufbauen zu können</string>
<string name="alert_text_no_input_username">Bitte geben Sie Ihren Benutzernamen ein</string>
<string name="profile_cert_import">Import certificate from VPN profile</string>
<string name="profile_cert_alias">Certificate for \"%1$s\"</string>
<string name="profile_profile_id">Profile ID</string>
+ <string name="profile_managed">Managed profile</string>
<!-- Warnings/Notifications in the details view -->
<string name="alert_text_no_input_gateway">A value is required to initiate the connection</string>
<string name="alert_text_no_input_username">Wprowadź swoją nazwę użytkownika</string>
<string name="profile_cert_import">Import certificate from VPN profile</string>
<string name="profile_cert_alias">Certificate for \"%1$s\"</string>
<string name="profile_profile_id">Profile ID</string>
+ <string name="profile_managed">Managed profile</string>
<!-- Warnings/Notifications in the details view -->
<string name="alert_text_no_input_gateway">A value is required to initiate the connection</string>
<string name="alert_text_no_input_username">Пожалуйста введите имя пользователя</string>
<string name="profile_cert_import">Import certificate from VPN profile</string>
<string name="profile_cert_alias">Certificate for \"%1$s\"</string>
<string name="profile_profile_id">Profile ID</string>
+ <string name="profile_managed">Managed profile</string>
<!-- Warnings/Notifications in the details view -->
<string name="alert_text_no_input_gateway">A value is required to initiate the connection</string>
<string name="alert_text_no_input_username">Введіть ім\'я користувача </string>
<string name="profile_cert_import">从VPN配置导入证书</string>
<string name="profile_cert_alias">\"%1$s\" 所对应的证书</string>
<string name="profile_profile_id">配置文件ID</string>
+ <string name="profile_managed">Managed profile</string>
<!-- Warnings/Notifications in the details view -->
<string name="alert_text_no_input_gateway">必填信息以初始化连接</string>
<string name="alert_text_no_input_username">请输入您的用户名</string>
<string name="profile_cert_import">從VPN設定檔匯入憑證</string>
<string name="profile_cert_alias">\"%1$s\" 對應的憑證</string>
<string name="profile_profile_id">Profile ID</string>
+ <string name="profile_managed">Managed profile</string>
<!-- Warnings/Notifications in the details view -->
<string name="alert_text_no_input_gateway">請填寫必要訊息才能初始化連線</string>
<string name="alert_text_no_input_username">請輸入您的用戶名稱</string>
<string name="profile_cert_import">Import certificate from VPN profile</string>
<string name="profile_cert_alias">Certificate for \"%1$s\"</string>
<string name="profile_profile_id">Profile ID</string>
+ <string name="profile_managed">Managed profile</string>
<!-- Warnings/Notifications in the details view -->
<string name="alert_text_no_input_gateway">A value is required to initiate the connection</string>
<string name="alert_text_no_input_username">Please enter your username </string>