<?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="file"
            type="com.datarecovery.master.utils.ImageDeepDetector.ImageFile" />

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

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/iv_bg"
            imageUri="@{file.uri}"
            radius="@{4}"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:scaleType="centerCrop"
            app:layout_constraintDimensionRatio="1:1"
            app:layout_constraintTop_toTopOf="parent"
            tools:src="@color/white" />

        <TextView
            isGone="@{!file.isTrial}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/bg_free_label"
            android:paddingHorizontal="8dp"
            android:paddingVertical="1dp"
            android:text="@string/free"
            android:textColor="@color/white"
            android:textSize="12dp"
            app:layout_constraintEnd_toEndOf="@+id/iv_bg"
            app:layout_constraintTop_toTopOf="@+id/iv_bg" />

        <View
            android:id="@+id/bg_label"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="@drawable/bg_recover_label"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintDimensionRatio="104:20" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{@string/recover_img_label_text(file.fileType,file.sizeDescribe)}"
            android:textColor="@color/white"
            android:textSize="12dp"
            app:layout_constraintBottom_toBottomOf="@+id/bg_label"
            app:layout_constraintEnd_toEndOf="@+id/bg_label"
            app:layout_constraintStart_toStartOf="@+id/bg_label"
            app:layout_constraintTop_toTopOf="@+id/bg_label"
            tools:text="PNG 41.8kb" />

        <ImageView
            expandTouchSize="@{4}"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:onClick="@{checkBoxClick}"
            android:src="@{file.check ? @drawable/icon_recover_checked : @drawable/icon_recover_un_check}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintDimensionRatio="1:1"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0952380952380952"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0952380952380952"
            app:layout_constraintWidth_percent="0.1923076923076923"
            tools:src="@drawable/icon_recover_un_check" />

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