<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 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.
-->

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ConnectivityToolsFragment" >

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

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/ping_server_ip_address_layout"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:hint="Server IP Address">
        <AutoCompleteTextView
            android:id="@+id/ping_server_ip_address_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="fdde:ad00:beef::ff:fe00:7400"
            android:textSize="14sp"/>
    </com.google.android.material.textfield.TextInputLayout>

    <Button
        android:id="@+id/ping_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:text="Ping"
        android:textSize="20dp"/>

    <TextView
        android:id="@+id/ping_output_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:scrollbars="vertical"
        android:textIsSelectable="true"/>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:orientation="horizontal" >

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/udp_server_ip_address_layout"
            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:hint="Server IP Address">
            <AutoCompleteTextView
                android:id="@+id/udp_server_ip_address_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="fdde:ad00:beef::ff:fe00:7400"
                android:textSize="14sp"/>
        </com.google.android.material.textfield.TextInputLayout>

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/udp_server_port_layout"
            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="2dp"
            android:hint="Server Port">
            <AutoCompleteTextView
                android:id="@+id/udp_server_port_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:inputType="number"
                android:text="12345"
                android:textSize="14sp"/>
        </com.google.android.material.textfield.TextInputLayout>
    </LinearLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/udp_message_layout"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:hint="UDP Message">
        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/udp_message_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Hello Thread!"
            android:textSize="14sp"/>
    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.switchmaterial.SwitchMaterial
        android:id="@+id/switch_bind_thread_network"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="true"
        android:text="Bind to Thread network" />

    <Button
        android:id="@+id/send_udp_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:text="Send UDP Message"
        android:textSize="20dp"/>

    <TextView
        android:id="@+id/udp_output_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:scrollbars="vertical"
        android:textIsSelectable="true"/>
</LinearLayout>
</ScrollView>
