<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/message_bg"
    tools:context=".home.AddDeviceActivity">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/topBar"
        android:layout_width="0dp"
        android:layout_height="56dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:id="@+id/ivBack"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginStart="16dp"
            android:src="@mipmap/back"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/tvTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/add_device_title"
            android:textColor="@color/black"
            android:textSize="16dp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
    </androidx.constraintlayout.widget.ConstraintLayout>

    <LinearLayout
        android:id="@+id/contentLayout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="16dp"
        android:background="@drawable/bg_white"
        android:orientation="vertical"
        android:padding="16dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/topBar">

        <TextView
            android:id="@+id/tvScanTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/scan_nearby"
            android:textColor="@color/black"
            android:textSize="16dp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/tvScanSubtitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:text="@string/scanning"
            android:textColor="@color/gray"
            android:textSize="14dp" />

        <FrameLayout
            android:id="@+id/deviceContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp">
            <!--动画层 -->
            <LinearLayout
                android:id="@+id/animationContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:visibility="visible"
                android:orientation="vertical">

                <ImageView
                    android:id="@+id/ivScanAnimation"
                    android:layout_width="match_parent"
                    android:layout_height="260dp"
                    android:src="@drawable/add_d" />

                <TextView
                    android:id="@+id/tvEmptyHint"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    android:text="@string/device_nearby_hint"
                    android:textColor="@color/gray"
                    android:textSize="14dp" />
            </LinearLayout>
            <!-- 初始隐藏 -->
            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rvDevices"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:orientation="horizontal"/>
        </FrameLayout>
    </LinearLayout>

    <android.widget.Button
        android:id="@+id/btnScanAdd"
        android:layout_width="0dp"
        android:layout_height="40dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="16dp"
        android:background="@drawable/rounded_blue_bg"
        android:text="@string/scan_add"
        android:textColor="@color/white"
        android:textSize="16dp"
        android:textStyle="bold"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/contentLayout" />

</androidx.constraintlayout.widget.ConstraintLayout>