<?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.HomeItem" />

        <variable
            name="viewModel"
            type="com.topjohnwu.magisk.redesign.home.HomeViewModel" />

    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="?selectableItemBackground"
        android:onClick="@{() -> viewModel.onLinkPressed(item.link)}"
        tools:layout_gravity="center"
        android:padding="@dimen/l_50">

        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/developer_link"
            style="?styleImageNormal"
            app:tint="?colorOnSurface"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@{item.icon}"
            tools:srcCompat="@drawable/ic_paypal" />

        <androidx.appcompat.widget.AppCompatTextView
            android:id="@+id/developer_link_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/l_50"
            android:text="@{item.title}"
            android:textAppearance="?appearanceTextCaptionNormal"
            android:textStyle="bold"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/developer_link"
            tools:text="Paypal" />

        <androidx.appcompat.widget.AppCompatImageView
            style="?styleImageSmall"
            android:layout_height="14sp"
            app:layout_constraintBottom_toBottomOf="@+id/developer_link_name"
            app:layout_constraintStart_toEndOf="@+id/developer_link_name"
            app:layout_constraintTop_toTopOf="@+id/developer_link_name"
            app:srcCompat="@drawable/ic_more"
            app:tint="?colorTextTransient" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</layout>