<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="12dp">

    <TextView
        android:id="@+id/text_status"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:maxLines="2"
        android:text="@string/searching" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="8dp"
        android:layout_weight="1"
        android:orientation="vertical">

        <ListView
            android:id="@+id/list_devices"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="0.4"
            android:choiceMode="singleChoice" />

        <FrameLayout
            android:id="@+id/panel_preview"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginTop="8dp"
            android:layout_weight="0.6"
            android:background="#101010">

            <TextureView
                android:id="@+id/texture_preview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:visibility="gone" />

            <TextView
                android:id="@+id/text_preview_label"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center"
                android:padding="16dp"
                android:text="@string/preview_placeholder"
                android:textColor="#CCCCCC" />
        </FrameLayout>
    </LinearLayout>

    <EditText
        android:id="@+id/edit_pin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:hint="@string/pin_hint"
        android:inputType="numberPassword"
        android:maxLength="32" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:gravity="center_horizontal"
        android:orientation="horizontal">

        <com.google.android.material.switchmaterial.SwitchMaterial
            android:id="@+id/switch_mute"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checked="false"
            android:text="@string/label_mute" />

        <Button
            android:id="@+id/btn_start_cast"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:minWidth="120dp"
            android:text="@string/start_cast" />
    </LinearLayout>

    <FrameLayout
        android:id="@+id/panel_advanced"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:visibility="gone" />

    <ProgressBar
        android:id="@+id/progress_discovery"
        style="?android:attr/progressBarStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end"
        android:visibility="gone" />
</LinearLayout>
