<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <SurfaceView
        android:id="@+id/surfacePreviewView"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/textureView"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

<!--    <SurfaceView-->
<!--        android:id="@+id/textureView"-->
<!--        android:layout_width="0dp"-->
<!--        android:layout_height="match_parent"-->
<!--        android:layout_weight="1"-->
<!--        app:layout_constraintBottom_toBottomOf="parent"-->
<!--        app:layout_constraintEnd_toEndOf="parent"-->
<!--        app:layout_constraintStart_toEndOf="@+id/surfacePreviewView"-->
<!--        app:layout_constraintTop_toTopOf="parent"-->
<!--        android:visibility="invisible"-->
<!--        />-->

    <TextureView
        android:id="@+id/textureView"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@+id/surfacePreviewView"
        app:layout_constraintTop_toTopOf="parent"
        android:visibility="invisible"
        />

    <TextView
        android:id="@+id/tvLocalPreview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="本机预览"
        android:textColor="#FFEB3B"
        android:textSize="25dp"
        android:textStyle="bold"
        app:layout_constraintEnd_toEndOf="@+id/surfacePreviewView"
        app:layout_constraintStart_toStartOf="@+id/surfacePreviewView"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/tvOtherPreview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="观看指定车机"
        android:textColor="#FF5722"
        android:textSize="25dp"
        android:textStyle="bold"
        app:layout_constraintEnd_toEndOf="@+id/textureView"
        app:layout_constraintStart_toStartOf="@+id/textureView"
        app:layout_constraintTop_toTopOf="parent" />


    <TextView
        android:id="@+id/tvLiveStatus"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#FFFF"
        android:padding="10dp"
        android:text="直播已停止"
        android:textSize="18dp"
        android:textStyle="bold"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <LinearLayout
        android:id="@+id/flTestPanel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <ToggleButton
            android:id="@+id/btnLive"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="10dp"
            android:textOff="@string/start"
            android:textOn="@string/stop" />

        <ToggleButton
            android:id="@+id/btnChangeCameraState"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="10dp"
            android:textOff="设置不可直播"
            android:textOn="设置可直播" />

        <ToggleButton
            android:id="@+id/btnSaveFile"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="10dp"
            android:textOff="开始录制"
            android:textOn="停止录制"
            android:visibility="gone" />

    </LinearLayout>


    <EditText
        android:id="@+id/etLookRoomId"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:hint="请输入要查看的车机SN"
        android:text="F803BB2037EZD00088"
        android:textColor="#000"
        app:layout_constraintBottom_toTopOf="@+id/liveToggleBtn"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="@+id/textureView" />

    <ToggleButton
        android:id="@+id/tbLoginMultiRoom"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textOff="登录第二个房间"
        android:textOn="退出第二个房间"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="@+id/etLookRoomId" />

    <ToggleButton
        android:id="@+id/liveToggleBtn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textOff="开始拉流"
        android:textOn="停止拉流"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toRightOf="@+id/tbLoginMultiRoom" />

    <TextView
        android:id="@+id/tvWifiState"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="wifi State :0"
        android:textColor="#17FBF4"
        android:textSize="32px"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintRight_toRightOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>