<?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="item"
            type="com.topjohnwu.magisk.model.entity.recycler.HideProcessRvItem" />

        <variable
            name="viewModel"
            type="com.topjohnwu.magisk.ui.hide.HideViewModel" />

    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:onClick="@{() -> item.toggle()}">

        <androidx.appcompat.widget.AppCompatTextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/margin_generic"
            android:ellipsize="marquee"
            android:singleLine="true"
            android:text="@{item.process}"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="@android:color/tertiary_text_dark"
            android:textIsSelectable="false"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/hide_process_icon"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="com.topjohnwu.magisk.process" />

        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/hide_process_icon"
            style="@style/Widget.Icon"
            isChecked="@{item.isHidden}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:tint="?attr/imageColorTint"
            tools:src="@drawable/ic_checked" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</layout>
