<?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"
    xmlns:tools="http://schemas.android.com/tools"
    style="@style/dialog_card"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingStart="@dimen/dialog_margin_horizontal"
        android:paddingTop="@dimen/dialog_margin_top"
        android:paddingEnd="@dimen/dialog_margin_horizontal"
        android:paddingBottom="@dimen/dialog_margin_bottom">

        <!-- Header: small label + main title -->
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fontFamily="@font/stolzl_regular"
            android:text="@string/range_test_dialog_demo_label"
            android:textColor="@color/silabs_redtheme_scanner_body_text_color"
            android:textSize="@dimen/text_size_S" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/matter_4dp"
            android:layout_marginBottom="@dimen/matter_16dp"
            android:fontFamily="@font/stolzl_regular"
            android:text="@string/demo_range_select_mode"
            android:textColor="@color/silabs_primary_text"
            android:textSize="@dimen/text_size_SM"
            android:textStyle="bold" />

        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/matter_1dp"
            android:background="@color/silabs_divider" />

        <!-- Device info -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingTop="@dimen/matter_16dp"
            android:paddingBottom="@dimen/matter_16dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/matter_8dp"
                android:fontFamily="@font/stolzl_regular"
                android:text="@string/range_device_info"
                android:textColor="@color/silabs_dark_gray_text"
                android:textSize="@dimen/text_size_S" />

            <TextView
                android:id="@+id/tv_tx_power"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/matter_4dp"
                android:fontFamily="@font/stolzl_regular"
                android:textColor="@color/silabs_primary_text"
                android:textSize="@dimen/text_size_SM"
                tools:text="+20 dBm" />

            <TextView
                android:id="@+id/tv_device_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/matter_4dp"
                android:fontFamily="@font/stolzl_regular"
                android:textColor="@color/silabs_primary_text"
                android:textSize="@dimen/text_size_SM"
                tools:text="Blinky Example" />

            <TextView
                android:id="@+id/tv_device_number"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fontFamily="@font/stolzl_regular"
                android:textAllCaps="true"
                android:textColor="@color/silabs_primary_text"
                android:textSize="@dimen/text_size_SM"
                tools:text="EFR32MG12P43F1024GL125 - BRD4164A" />
        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/matter_1dp"
            android:background="@color/silabs_divider" />

        <!-- TX Mode row -->
        <LinearLayout
            android:id="@+id/tx_mode"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:focusable="true"
            android:foreground="?attr/selectableItemBackground"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingTop="@dimen/matter_12dp"
            android:paddingBottom="@dimen/matter_12dp">

            <ImageView
                android:layout_width="@dimen/matter_40dp"
                android:layout_height="@dimen/matter_40dp"
                android:layout_marginEnd="@dimen/matter_8dp"
                android:background="@drawable/ic_tx_mode"
                android:contentDescription="@null"
                android:padding="@dimen/matter_8dp"
                android:src="@drawable/range_test_demo" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/matter_8dp"
                android:contentDescription="@null"
                android:src="@drawable/ic_arrow_tx_mode" />

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:fontFamily="@font/stolzl_medium"
                android:text="@string/demo_range_mode_tx"
                android:textColor="@color/silabs_primary_text"
                android:textSize="@dimen/text_size_SM"
                android:textStyle="bold" />
        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/matter_1dp"
            android:background="@color/silabs_divider" />

        <!-- RX Mode row -->
        <LinearLayout
            android:id="@+id/rx_mode"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:focusable="true"
            android:foreground="?attr/selectableItemBackground"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingTop="@dimen/matter_12dp"
            android:paddingBottom="@dimen/matter_12dp">

            <ImageView
                android:layout_width="@dimen/matter_40dp"
                android:layout_height="@dimen/matter_40dp"
                android:layout_marginEnd="@dimen/matter_8dp"
                android:background="@drawable/ic_rx_mode"
                android:contentDescription="@null"
                android:padding="@dimen/matter_8dp"
                android:src="@drawable/range_test_demo" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/matter_8dp"
                android:contentDescription="@null"
                android:src="@drawable/ic_arrow_rx_mode" />

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:fontFamily="@font/stolzl_medium"
                android:text="@string/demo_range_mode_rx"
                android:textColor="@color/silabs_primary_text"
                android:textSize="@dimen/text_size_SM"
                android:textStyle="bold" />
        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/matter_1dp"
            android:background="@color/silabs_divider" />

        <!-- Spacer before footer -->
        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/matter_24dp"
            android:background="@color/range_test_dialog_spacer" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/btn_cancel"
            android:layout_gravity="center_horizontal"
            android:layout_width="@dimen/range_test_btn_width"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/matter_16dp"
            android:fontFamily="@font/stolzl_medium"
            android:minHeight="@dimen/matter_48dp"
            android:text="@string/button_cancel"
            android:textAllCaps="false"
            android:textColor="@color/silabs_white"
            android:textSize="@dimen/text_size_SM"
            android:textStyle="bold"
            app:backgroundTint="@color/silabs_redtheme_button_fill_color"
            app:cornerRadius="@dimen/silabs_btn_radius"
            app:rippleColor="@color/sl_light_grey" />
    </LinearLayout>
</androidx.cardview.widget.CardView>
