<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>
        <import type="android.view.View" />
        <variable
            name="vm"
            type="com.example.iot_controlhost.ui.viewmodel.AppBarViewModel" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/linearLayout7"
        android:layout_width="1280dp"
        android:layout_height="100dp"
        android:orientation="horizontal"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:id="@+id/type_Logo"
            android:layout_width="200dp"
            android:layout_height="match_parent"
            android:layout_marginVertical="14dp"
            android:layout_marginStart="27dp"
            android:imageDrawable="@{vm.logoType}"
            android:onClick="@{()->vm.enterSetActivity()}"
            android:padding="5dp"
            app:layout_constraintStart_toStartOf="parent"
            tools:layout_editor_absoluteY="0dp" />

        <LinearLayout
            android:id="@+id/ll_error"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_marginVertical="5dp"
            android:gravity="center_vertical"
            android:layout_marginStart="60dp"
            android:orientation="horizontal"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toEndOf="@+id/type_Logo"
            app:layout_constraintTop_toTopOf="parent"></LinearLayout>

        <TextView
            android:id="@+id/tv_time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="20dp"
            android:gravity="center"
            android:orientation="vertical"
            android:text="@{vm.dateStr}"
            android:textSize="20dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/tv_weather"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/tv_weather"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:paddingHorizontal="20dp"
            android:textAlignment="center"
            android:gravity="center"
            android:layout_marginEnd="20dp"
            android:text="@{vm.weatherStr}"
            android:onClick="@{v->vm.showWeatherTips()}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/iv_net_server"
            app:layout_constraintTop_toTopOf="parent" />

        <ImageView
            android:id="@+id/iv_net_server"
            android:layout_width="36dp"
            android:layout_height="36dp"
            android:layout_marginEnd="20dp"
            android:src="@mipmap/server_0"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/iv_net_state"
            app:layout_constraintTop_toTopOf="parent" />

        <ImageView
            android:id="@+id/iv_net_state"
            android:layout_width="36dp"
            android:layout_height="36dp"
            android:layout_marginEnd="30dp"
            android:src="@mipmap/network_0"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="@+id/iv_sos"
            app:layout_constraintEnd_toStartOf="@+id/iv_sos"
            app:layout_constraintTop_toTopOf="parent" />

        <ImageView
            android:id="@+id/iv_sos"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:layout_marginVertical="10dp"
            android:layout_marginEnd="30dp"
            android:src="@mipmap/sos"
            android:onClick="@{()->vm.sosConform()}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>