<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2025 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fadeScrollbars="false"
        android:scrollIndicators="top|bottom">

    <LinearLayout
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:theme="@style/Theme.Network"
        android:id="@+id/l_ethernetdialog"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingBottom="8dip">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="16dp">

            <TextView
                android:id="@+id/ethernet_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/ethernet_item_label"
                android:text="Port name"
                android:textSize="16sp"
                android:textColor="@android:color/holo_blue_dark"
                android:layout_marginBottom="8dp" />

            <EditText
                android:id="@+id/ethernet_name_edit_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/ethernet_item_edit_content"
                android:background="@null"
                android:hint="Ethernet"
                android:inputType="text"
                android:paddingBottom="8dp"
                android:textColor="@android:color/black"
                android:textSize="16sp"
                android:maxLines="1"
                android:minLines="1"/>

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="@android:color/darker_gray" />

        </LinearLayout>

        <LinearLayout android:id="@+id/wifi_advanced_toggle"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      style="@style/wifi_item"
                      android:paddingTop="2dp"
                      android:paddingBottom="4dp"
                      android:importantForAccessibility="no"
                      android:visibility="visible">
            <CheckBox android:id="@+id/wifi_advanced_togglebox"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      style="@style/wifi_advanced_toggle"
                      android:importantForAccessibility="yes"
                      android:contentDescription="@string/wifi_advanced_toggle_description"
                      android:text="@string/wifi_show_advanced"/>
        </LinearLayout>

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

            <LinearLayout android:id="@+id/proxy_settings_fields"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          style="@style/wifi_item"
                          android:visibility="visible">

                <TextView android:id="@+id/proxy_settings_title"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          style="@style/wifi_item_label"
                          android:text="@string/proxy_settings_title"/>

                <Spinner android:id="@+id/proxy_settings"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         style="@style/wifi_item_spinner"
                         android:prompt="@string/proxy_settings_title"
                         android:entries="@array/wifi_proxy_settings"/>

            </LinearLayout>

            <LinearLayout android:id="@+id/proxy_warning_limited_support"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          style="@style/wifi_item"
                          android:visibility="gone">
                <!--  Placeholder to enable right-justification of warning -->
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    style="@style/wifi_item_label"/>

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/wifi_item_content"
                    android:text="@string/proxy_warning_limited_support"/>
            </LinearLayout>

            <LinearLayout android:id="@+id/proxy_pac_field"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          style="@style/wifi_section"
                          android:visibility="gone">
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/wifi_item">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/wifi_item_label"
                        android:text="@string/proxy_url_title"/>

                    <EditText android:id="@+id/proxy_pac"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              style="@style/wifi_item_edit_content"
                              android:hint="@string/proxy_url_hint"
                              android:inputType="textNoSuggestions"
                              android:singleLine="true"/>
                </LinearLayout>
            </LinearLayout>
            <LinearLayout android:id="@+id/proxy_fields"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          style="@style/wifi_section"
                          android:visibility="gone">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/wifi_item">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/wifi_item_label"
                        android:text="@string/proxy_hostname_label"/>

                    <EditText android:id="@+id/proxy_hostname"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              style="@style/wifi_item_edit_content"
                              android:hint="@string/proxy_hostname_hint"
                              android:inputType="textNoSuggestions"
                              android:singleLine="true"/>
                </LinearLayout>
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/wifi_item">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/wifi_item_label"
                        android:text="@string/proxy_port_label"/>

                    <EditText android:id="@+id/proxy_port"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              style="@style/wifi_item_edit_content"
                              android:hint="@string/proxy_port_hint"
                              android:inputType="number"
                              android:singleLine="true"/>
                </LinearLayout>
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/wifi_item">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/wifi_item_label"
                        android:text="@string/proxy_exclusionlist_label"/>

                    <EditText android:id="@+id/proxy_exclusionlist"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              style="@style/wifi_item_edit_content"
                              android:hint="@string/proxy_exclusionlist_hint"
                              android:inputType="textNoSuggestions"
                              android:singleLine="true"/>
                </LinearLayout>
            </LinearLayout>

            <LinearLayout android:id="@+id/ip_fields"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          style="@style/ethernet_item"
                          android:visibility="visible">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    style="@style/ethernet_item_label"
                    android:text="@string/ethernet_ip_settings"/>

                <Spinner android:id="@+id/ip_settings"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         style="@style/ethernet_item_spinner"
                         android:prompt="@string/ethernet_ip_settings"
                         android:entries="@array/ethernet_ip_settings"/>

            </LinearLayout>

            <LinearLayout android:id="@+id/staticip"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          style="@style/ethernet_section"
                          android:visibility="gone">
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/ethernet_item">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/ethernet_item_label"
                        android:text="@string/ethernet_ip_address"/>

                    <EditText android:id="@+id/ipaddress"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              style="@style/ethernet_item_edit_content"
                              android:singleLine="true"
                              android:hint="@string/ethernet_ip_address_hint"
                              android:inputType="textNoSuggestions"/>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/ethernet_item">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/ethernet_item_label"
                        android:text="@string/ethernet_gateway"/>

                    <EditText android:id="@+id/gateway"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              style="@style/ethernet_item_edit_content"
                              android:singleLine="true"
                              android:hint="@string/ethernet_gateway_hint"
                              android:inputType="textNoSuggestions"/>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/ethernet_item">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/ethernet_item_label"
                        android:text="@string/ethernet_network_prefix_length"/>

                    <EditText android:id="@+id/network_prefix_length"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              style="@style/ethernet_item_edit_content"
                              android:singleLine="true"
                              android:hint="@string/ethernet_network_prefix_length_hint"
                              android:inputType="number"/>
                </LinearLayout>
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/ethernet_item">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/ethernet_item_label"
                        android:text="@string/ethernet_dns1"/>

                    <EditText android:id="@+id/dns1"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              style="@style/ethernet_item_edit_content"
                              android:singleLine="true"
                              android:hint="@string/ethernet_dns1_hint"
                              android:inputType="textNoSuggestions"/>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/ethernet_item">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        style="@style/ethernet_item_label"
                        android:text="@string/ethernet_dns2"/>

                    <EditText android:id="@+id/dns2"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              style="@style/ethernet_item_edit_content"
                              android:singleLine="true"
                              android:hint="@string/ethernet_dns2_hint"
                              android:inputType="textNoSuggestions"/>
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

</androidx.core.widget.NestedScrollView>