<?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>

        <variable
            name="bean"
            type="com.atmob.voiceai.data.api.bean.VoiceListBean" />


        <variable
            name="choiceClick"
            type="android.view.View.OnClickListener" />

        <import type="com.atmob.common.ui.SizeUtil" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="8dp">

        <ImageView
            placeholder="@{null}"
            error="@{null}"
            android:id="@+id/iv_avatar"
            imageUrl="@{bean.avatarUrl}"
            isGone="@{bean.isAddIcon}"
            radius="@{12}"
            android:layout_width="@{(float)SizeUtil.getScreenWidth() * 0.2f, default=wrap_content}"
            android:layout_height="0dp"
            android:onClick="@{choiceClick}"
            app:layout_constraintDimensionRatio="1:1"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:src="@drawable/icon_default_avatar" />

        <TextView
            isGone="@{!bean.hasNew}"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@drawable/bg_voice_new"
            android:gravity="center"
            android:lines="1"
            android:paddingBottom="1dp"
            android:text="@string/voice_new"
            android:textColor="@color/white"
            android:textSize="10dp"
            app:layout_constraintDimensionRatio="29:15"
            app:layout_constraintEnd_toEndOf="@+id/iv_avatar"
            app:layout_constraintTop_toTopOf="@id/iv_avatar"
            app:layout_constraintWidth_percent="0.3717948717948718" />

        <ImageView
            isGone="@{!bean.hasPro}"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_margin="4dp"
            android:src="@drawable/icon_voice_vip_use"
            app:layout_constraintBottom_toBottomOf="@+id/iv_avatar"
            app:layout_constraintDimensionRatio="1:1"
            app:layout_constraintEnd_toEndOf="@+id/iv_avatar"
            app:layout_constraintWidth_percent="0.2564102564102564" />

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:gravity="center"
            android:lines="1"
            android:text="@{bean.name}"
            android:textColor="@color/white"
            android:textSize="12sp"
            app:layout_constraintEnd_toEndOf="@+id/iv_avatar"
            app:layout_constraintStart_toStartOf="@+id/iv_avatar"
            app:layout_constraintTop_toBottomOf="@+id/iv_avatar"
            tools:text="Add Voice" />


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