<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="@dimen/dialog_margin_top"
    android:layout_marginBottom="@dimen/dialog_margin_bottom"
    style="@style/dialog_card">

    <LinearLayout
        style="@style/dialog_margins"
        android:layout_marginHorizontal="@dimen/dialog_margin_horizontal"
        android:layout_width="match_parent"
        android:minWidth="300dp"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <TextView
            style="@style/dialog_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/dialog_title_margin_bottom"
            android:text="@string/gatt_configurator_title_add_a_gatt_service" />

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/silabs_white"
                android:clipToPadding="false"
                android:orientation="vertical">

                <AutoCompleteTextView
                    android:id="@+id/actv_service_name"
                    style="@style/EditTextSmall"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/gatt_configurator_hint_service_name"
                    android:popupTheme="@style/ThemeOverlay.Silabs.DropdownList" />

                <AutoCompleteTextView
                    android:id="@+id/actv_service_uuid"
                    style="@style/EditTextSmall"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:digits="0123456789ABCDEFabcdef-"
                    android:hint="@string/gatt_configurator_hint_16_128_bit_uuid"
                    android:maxLength="36"
                    android:popupTheme="@style/ThemeOverlay.Silabs.DropdownList" />

                <androidx.appcompat.widget.AppCompatCheckBox
                    android:id="@+id/cb_mandatory_requirements"
                    style="@style/full_line_checkbox_view"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:layoutDirection="inherit"
                    android:enabled="false"
                    android:textStyle="normal"
                    android:text="@string/gatt_configurator_label_add_mandatory_service_requirements"
                    app:buttonTint="@color/filter_fragment_checkbox_button_tint" />

                <Spinner
                    android:id="@+id/sp_service_type"
                    style="@style/CustomSpinner"
                    android:layout_width="match_parent"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="8dp"
                    android:entries="@array/gatt_configurator_service_type" />

                <TextView
                    style="@style/TextSmall"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/gatt_configurator_note_insert_name_and_uuid"
                    android:textColor="@color/silabs_dark_gray_text" />

                <TextView
                    style="@style/TextSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    android:text="@string/gatt_configurator_note_full_list_of_16bit_services"
                    android:textColor="@color/silabs_dark_gray_text" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/btn_bluetooth_gatt_services"
                    style="@style/button_add_data_outlined"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="@dimen/matter_12dp"
                    android:text="@string/button_bluetooth_sig" />
            </LinearLayout>
        </ScrollView>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_gravity="end"
            android:layout_marginTop="@dimen/dialog_button_margin_top">

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btn_clear"
                style="@style/button_add_data_outlined"
                android:layout_width="wrap_content"
                app:layout_constraintStart_toStartOf="parent"
                android:layout_height="wrap_content"
                app:layout_constraintTop_toTopOf="parent"
                android:text="@string/button_clear"
                app:cornerRadius="@dimen/matter_12dp"/>

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btn_cancel"
                style="@style/button_add_data_outlined"
                android:layout_width="wrap_content"
                app:layout_constraintStart_toEndOf="@id/btn_clear"
                android:layout_height="wrap_content"
                app:layout_constraintTop_toTopOf="parent"
                android:layout_marginStart="@dimen/dialog_margin_between_buttons"
                android:text="@string/button_cancel"
                app:cornerRadius="@dimen/matter_12dp"/>

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btn_save"
                style="@style/Widget.MaterialComponents.Button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dialog_margin_between_buttons"
                android:enabled="false"
                android:text="@string/button_save"
                android:textAllCaps="false"
                android:textColor="@color/silabs_white"
                app:backgroundTint="@color/gatt_configurator_save_button_background_tint"
                app:cornerRadius="@dimen/matter_12dp"
                app:layout_constraintStart_toEndOf="@id/btn_cancel"
                app:layout_constraintTop_toTopOf="parent"
                app:textAllCaps="false" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </LinearLayout>
</androidx.cardview.widget.CardView>