<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2012-2025 Tobias Brunner
    Copyright (C) 2012 Giuliano Grassi
    Copyright (C) 2012 Ralf Sager

    Copyright (C) secunet Security Networks AG

    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.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <TextView
        android:id="@+id/managed_profile"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/state_background"
        app:drawableStartCompat="@android:drawable/ic_dialog_alert"
        android:drawablePadding="8dp"
        android:padding="8dp"
        android:text="@string/alert_text_vpn_profile_read_only"
        android:textColor="?android:attr/textColorPrimary"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textStyle="bold"
        android:visibility="gone"
        app:layout_constraintTop_toTopOf="parent"
        tools:visibility="visible" />

    <ScrollView
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/managed_profile">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:animateLayoutChanges="true"
            android:orientation="vertical"
            android:padding="10dp">

            <org.strongswan.android.ui.widget.TextInputLayoutHelper
                android:id="@+id/gateway_wrap"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp"
                android:hint="@string/profile_gateway_label"
                app:helper_text="@string/profile_gateway_hint">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/gateway"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textNoSuggestions"
                    android:singleLine="true" />

            </org.strongswan.android.ui.widget.TextInputLayoutHelper>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="4dp"
                android:text="@string/profile_vpn_type_label"
                android:textSize="12sp" />

            <Spinner
                android:id="@+id/vpn_type"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:entries="@array/vpn_types"
                android:spinnerMode="dropdown" />

            <include
                android:id="@+id/tnc_notice"
                layout="@layout/two_line_button"
                android:visibility="gone" />

            <LinearLayout
                android:id="@+id/username_password_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/username_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:hint="@string/profile_username_label">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/username"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/password_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:hint="@string/profile_password_label"
                    app:helper_text="@string/profile_password_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/password"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textPassword|textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/user_certificate_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="4dp"
                android:orientation="vertical">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="4dp"
                    android:text="@string/profile_user_certificate_label"
                    android:textSize="12sp" />

                <include
                    android:id="@+id/select_user_certificate"
                    layout="@layout/two_line_button" />

                <Button
                    android:id="@+id/install_user_certificate"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginEnd="4dp"
                    android:text="@string/profile_user_certificate_install" />

            </LinearLayout>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="4dp"
                android:text="@string/profile_ca_label"
                android:textSize="12sp" />

            <CheckBox
                android:id="@+id/ca_auto"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text="@string/profile_ca_auto_label" />

            <include
                android:id="@+id/select_certificate"
                layout="@layout/two_line_button" />

            <org.strongswan.android.ui.widget.TextInputLayoutHelper
                android:id="@+id/name_wrap"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:hint="@string/profile_name_label"
                app:helper_text="@string/profile_name_hint">

                <MultiAutoCompleteTextView
                    android:id="@+id/name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:completionThreshold="1"
                    android:inputType="textNoSuggestions"
                    android:singleLine="true" />

            </org.strongswan.android.ui.widget.TextInputLayoutHelper>

            <CheckBox
                android:id="@+id/show_advanced"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/profile_show_advanced_label" />

            <LinearLayout
                android:id="@+id/advanced_settings"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="10dp"
                    android:text="@string/profile_advanced_label"
                    android:textSize="20sp" />

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/remote_id_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:hint="@string/profile_remote_id_label"
                    app:helper_text="@string/profile_remote_id_hint">

                    <MultiAutoCompleteTextView
                        android:id="@+id/remote_id"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:completionThreshold="1"
                        android:inputType="textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/local_id_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_local_id_label"
                    app:helper_text="@string/profile_local_id_hint_user">

                    <MultiAutoCompleteTextView
                        android:id="@+id/local_id"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:completionThreshold="0"
                        android:inputType="textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/dns_servers_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_dns_servers_label"
                    app:helper_text="@string/profile_dns_servers_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/dns_servers"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/mtu_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_mtu_label"
                    app:helper_text="@string/profile_mtu_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/mtu"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="number|textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/port_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_port_label"
                    app:helper_text="@string/profile_port_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/port"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="number|textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/nat_keepalive_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_nat_keepalive_label"
                    app:helper_text="@string/profile_nat_keepalive_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/nat_keepalive"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="number|textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/cert_req"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:text="@string/profile_cert_req_label" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_cert_req_hint"
                    android:textSize="12sp" />

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/use_ocsp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:text="@string/profile_use_ocsp_label" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_use_ocsp_hint"
                    android:textSize="12sp" />

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/use_crl"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:text="@string/profile_use_crl_label" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_use_crl_hint"
                    android:textSize="12sp" />

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/strict_revocation"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:text="@string/profile_strict_revocation_label" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_strict_revocation_hint"
                    android:textSize="12sp" />

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/rsa_pss"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:text="@string/profile_rsa_pss_label" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_rsa_pss_hint"
                    android:textSize="12sp" />

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/ipv6_transport"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:text="@string/profile_ipv6_transport_label" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_ipv6_transport_hint"
                    android:textSize="12sp" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_split_tunneling_label"
                    android:textSize="20sp" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_split_tunneling_intro"
                    android:textSize="12sp" />

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/included_subnets_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_included_subnets_label"
                    app:helper_text="@string/profile_included_subnets_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/included_subnets"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/excluded_subnets_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_excluded_subnets_label"
                    app:helper_text="@string/profile_excluded_subnets_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/excluded_subnets"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <CheckBox
                    android:id="@+id/split_tunneling_v4"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/profile_split_tunnelingv4_title" />

                <CheckBox
                    android:id="@+id/split_tunneling_v6"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/profile_split_tunnelingv6_title" />

                <TextView
                    android:id="@+id/apps"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="20dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_select_apps_label"
                    android:textSize="20sp" />

                <Spinner
                    android:id="@+id/apps_handling"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:entries="@array/apps_handling"
                    android:spinnerMode="dropdown" />

                <include
                    android:id="@+id/select_applications"
                    layout="@layout/two_line_button" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_proposals_label"
                    android:textSize="20sp" />

                <TextView
                    android:id="@+id/proposal_intro"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_proposals_intro"
                    android:textSize="12sp" />

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/ike_proposal_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_proposals_ike_label"
                    app:helper_text="@string/profile_proposals_ike_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/ike_proposal"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/esp_proposal_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_proposals_esp_label"
                    app:helper_text="@string/profile_proposals_esp_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/esp_proposal"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_proxy_server_label"
                    android:textSize="20sp" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_proxy_server_intro"
                    android:textSize="12sp" />

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/proxy_host_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_proxy_host_label"
                    app:helper_text="@string/profile_proxy_host_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/proxy_host"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/proxy_port_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_proxy_port_label"
                    app:helper_text="@string/profile_proxy_port_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/proxy_port"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="number|textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <org.strongswan.android.ui.widget.TextInputLayoutHelper
                    android:id="@+id/proxy_exclusions_wrap"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/profile_proxy_exclusions_label"
                    app:helper_text="@string/profile_proxy_exclusions_hint">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/proxy_exclusions"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textNoSuggestions"
                        android:singleLine="true" />

                </org.strongswan.android.ui.widget.TextInputLayoutHelper>

                <TextView
                    android:id="@+id/profile_id_label"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:text="@string/profile_profile_id"
                    android:textSize="16sp" />

                <TextView
                    android:id="@+id/profile_id"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:textIsSelectable="true"
                    android:textSize="12sp" />

            </LinearLayout>

        </LinearLayout>

    </ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
