<?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.ui.hide.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:layout_gravity="center"
        android:alpha="@{item.hidden ? 1f : .7f}">

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/l1"
            android:layout_marginTop="@dimen/l_75"
            android:layout_marginEnd="@dimen/l1"
            android:layout_marginBottom="@dimen/l_75"
            android:singleLine="true"
            android:ellipsize="middle"
            android:text="@{item.displayName}"
            android:textAppearance="@style/AppearanceFoundation.Caption.Variant"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/hide_process_checkbox"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="com.topjohnwu.magisk" />

        <com.google.android.material.switchmaterial.SwitchMaterial
            android:id="@+id/hide_process_checkbox"
            android:checked="@={item.hidden}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/l_50"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</layout>
