<?xml version="1.0" encoding="utf-8"?>
<layout 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">

    <data>

        <import type="android.view.View" />

        <import type="android.text.TextUtils" />

        <variable
            name="item"
            type="com.ydl.confide.intro.VideoViewModel" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/black">

        <FrameLayout
            android:id="@+id/videoView"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:layout_constraintBottom_toTopOf="@+id/layoutCall"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <ImageView
            android:id="@+id/ivCover"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:imageUrl="@{item.coverUrl}"
            app:layout_constraintBottom_toBottomOf="@+id/videoView"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <ImageView
            android:id="@+id/ivPlay"
            android:layout_width="76dp"
            android:layout_height="76dp"
            android:src="@drawable/ic_video_play"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="@+id/videoView"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <com.yidianling.common.view.ui.VoicePlayingIcon
            android:id="@+id/voicePlay"
            android:layout_width="60dp"
            android:layout_height="28dp"
            android:layout_marginBottom="37dp"
            android:paddingLeft="22dp"
            android:paddingTop="6dp"
            android:paddingRight="22dp"
            android:paddingBottom="6dp"
            android:visibility="gone"
            app:layout_constraintBottom_toTopOf="@+id/tvName"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:shapeBg="@{0x26000000}"
            app:shapeRadius="@{14}"
            app:shapeStrokeColor="@{0xE6FFFFFF}"
            app:shapeStrokeWidth="@{1}" />

        <View
            android:id="@+id/vDisableClick"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@drawable/bg_expert_video_bottom_cover"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="@+id/tvName"
            tools:visibility="visible" />

        <SeekBar
            android:id="@+id/seekbar"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:maxHeight="10dp"
            android:paddingStart="0dp"
            android:paddingTop="8dp"
            android:paddingEnd="0dp"
            android:paddingBottom="8dp"
            android:progressDrawable="@drawable/confide_seekbar_style"
            android:splitTrack="false"
            android:thumb="@drawable/confide_seekbar_thumb"
            app:layout_constraintBottom_toTopOf="@+id/layoutCall"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent" />

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/layoutCall"
            android:layout_width="160dp"
            android:layout_height="47dp"
            android:layout_marginBottom="28dp"
            android:background="@{(item.lineStatus == 5 || item.lineStatus == 6) ? @drawable/confide_offline_book_bg : item.lineStatus==3?@drawable/confide_line_bg_3:(item.lineStatus==2?@drawable/confide_line_bg_2:@drawable/confide_line_bg_1)}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            tools:background="@drawable/confide_line_bg_1">

            <ImageView
                android:id="@+id/ivCall"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_marginRight="4dp"
                android:src="@drawable/ic_confide_call"
                android:visibility="@{item.lineStatus==1?View.VISIBLE:View.GONE}"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintHorizontal_chainStyle="packed"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toLeftOf="@+id/tvCall"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/tvCall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="立即拨打"
                android:textColor="@color/white"
                android:textSize="16sp"
                android:textStyle="bold"
                app:confideLineText="@{item.lineStatus}"
                app:layout_constraintBottom_toTopOf="@+id/tvTime"
                app:layout_constraintLeft_toRightOf="@+id/ivCall"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintVertical_chainStyle="packed" />

            <TextView
                android:id="@+id/tvTime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{item.remainingTime}"
                android:textColor="@color/white"
                android:textSize="10sp"
                android:visibility="@{TextUtils.isEmpty(item.remainingTime)?View.GONE:View.VISIBLE}"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toLeftOf="@+id/tvCall"
                app:layout_constraintRight_toRightOf="@+id/tvCall"
                app:layout_constraintTop_toBottomOf="@+id/tvCall"
                tools:text="剩余1分40秒" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <!--<TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/bg_confide_free"
            android:paddingLeft="5dp"
            android:paddingTop="2dp"
            android:paddingRight="5dp"
            android:paddingBottom="2dp"
            android:text="首单免费"
            android:textColor="@color/white"
            android:textSize="11sp"
            android:visibility="@{item.showFreeTag?View.VISIBLE:View.GONE}"
            app:layout_constraintCircle="@+id/layoutCall"
            app:layout_constraintCircleAngle="70"
            app:layout_constraintCircleRadius="70dp" />-->

        <com.facebook.drawee.view.SimpleDraweeView
            android:id="@+id/free"
            android:layout_width="@dimen/platform_dp_48"
            android:layout_height="@dimen/platform_dp_24"
            android:visibility="@{item.listenFree?View.VISIBLE:View.GONE}"
            app:layout_constraintCircle="@+id/layoutCall"
            app:layout_constraintCircleAngle="70"
            app:layout_constraintCircleRadius="70dp"
            tools:ignore="MissingConstraints" />

        <com.facebook.drawee.view.SimpleDraweeView
            android:id="@+id/confide_first_free"
            android:layout_width="@dimen/platform_dp_48"
            android:layout_height="@dimen/platform_dp_24"
            android:visibility="@{item.showFreeTag?View.VISIBLE:View.GONE}"
            app:layout_constraintCircle="@+id/layoutCall"
            app:layout_constraintCircleAngle="70"
            app:layout_constraintCircleRadius="70dp"
            tools:ignore="MissingConstraints" />

        <TextView
            android:id="@+id/tvTag"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="12dp"
            android:layout_marginRight="40dp"
            android:layout_marginBottom="60dp"
            android:maxLines="1"
            android:text="@{item.tag}"
            android:textColor="#99FFFFFF"
            android:textSize="13sp"
            app:layout_constraintBottom_toTopOf="@+id/layoutCall"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toLeftOf="@+id/btnShare"
            tools:text="tag|tag|tag" />

        <TextView
            android:id="@+id/tvIntro"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginRight="40dp"
            android:layout_marginBottom="8dp"
            android:maxLines="3"
            android:text="@{item.intro}"
            android:textColor="@color/white"
            android:textSize="15sp"
            app:layout_constraintBottom_toTopOf="@+id/tvTag"
            app:layout_constraintLeft_toLeftOf="@+id/tvTag"
            app:layout_constraintRight_toLeftOf="@+id/btnShare"
            tools:text="tag|tag|tag" />

        <TextView
            android:id="@+id/tvName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:text="@{item.name}"
            android:textColor="@color/white"
            android:textSize="19sp"
            app:layout_constraintBottom_toTopOf="@+id/tvIntro"
            app:layout_constraintLeft_toLeftOf="@+id/tvTag"
            tools:text="tag|tag|tag" />

        <TextView
            android:id="@+id/tvConfideCount"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginBottom="1dp"
            android:text="@{item.count}"
            android:textColor="@color/white"
            android:textSize="13sp"
            app:layout_constraintBottom_toBottomOf="@+id/tvName"
            app:layout_constraintLeft_toRightOf="@+id/tvName"
            tools:text="tag|tag|tag" />

        <LinearLayout
            android:id="@+id/btnShare"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="18dp"
            android:layout_marginBottom="55dp"
            android:orientation="vertical"
            app:layout_constraintBottom_toTopOf="@+id/layoutCall"
            app:layout_constraintRight_toRightOf="parent">

            <ImageView
                android:layout_width="29dp"
                android:layout_height="29dp"
                android:src="@drawable/ic_video_share" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/text_share" />
            <!--<TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="4dp"
                android:text="分享"
                android:textColor="@color/white"
                android:textSize="11sp" />-->
        </LinearLayout>

        <LinearLayout
            android:id="@+id/btnEvaluate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="18dp"
            android:layout_marginBottom="20dp"
            android:orientation="vertical"
            app:layout_constraintBottom_toTopOf="@+id/btnShare"
            app:layout_constraintRight_toRightOf="parent">

            <ImageView
                android:layout_width="29dp"
                android:layout_height="29dp"
                android:src="@drawable/ic_video_eval" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/text_eval" />
            <!--<TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="4dp"
                android:text="评价"
                android:textColor="@color/white"
                android:textSize="11sp" />-->
        </LinearLayout>

        <LinearLayout
            android:id="@+id/btnChat"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="18dp"
            android:layout_marginBottom="20dp"
            android:gravity="center"
            android:orientation="vertical"
            app:layout_constraintBottom_toTopOf="@+id/btnEvaluate"
            app:layout_constraintRight_toRightOf="parent">

            <ImageView
                android:layout_width="29dp"
                android:layout_height="29dp"
                android:src="@drawable/ic_video_chat" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/text_chat" />
            <!--<TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="4dp"
                android:text="私聊"
                android:textColor="@color/white"
                android:textSize="11sp" />-->
        </LinearLayout>

        <ImageView
            android:id="@+id/ivAvatar"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_marginRight="10dp"
            android:layout_marginBottom="20dp"
            android:padding="1dp"
            app:circle="@{true}"
            app:imageUrl="@{item.avatar}"
            app:layout_constraintBottom_toTopOf="@+id/btnChat"
            app:layout_constraintRight_toRightOf="parent"
            app:shape="@{1}"
            app:shapeBg="@{0x00FFFFFF}"
            app:shapeStrokeColor="@{0xFFFFFFFF}"
            app:shapeStrokeWidth="@{1}" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>
