<?xml version="1.0" encoding="utf-8"?>
<layout
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <data>
        <variable
            name="client"
            type="hanson.xyz.vpnhotspotmod.client.Client"/>
        <variable
            name="rate"
            type="hanson.xyz.vpnhotspotmod.client.ClientsFragment.TrafficRate"/>
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:focusable="true"
        android:background="?android:attr/selectableItemBackground"
        android:padding="16dp">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:importantForAccessibility="no"
            android:src="@{client.icon}"
            android:tint="?android:attr/textColorPrimary"
            tools:src="@drawable/ic_device_network_wifi"/>

        <Space
            android:layout_width="16dp"
            android:layout_height="0dp"/>

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical">

            <hanson.xyz.vpnhotspotmod.widget.LinkTextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{client.title}"
                android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
                android:textIsSelectable="@{client.titleSelectable}"
                tools:text="01:23:45:ab:cd:ef%p2p-p2p0-0"/>

            <hanson.xyz.vpnhotspotmod.widget.AutoCollapseTextView
                android:id="@+id/description"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{client.description}"
                android:textIsSelectable="true"
                tools:text="192.168.49.123 (reachable)\nfe80::abcd:efff:1234:5678%p2p-p2p0-0 (reachable)"/>

            <hanson.xyz.vpnhotspotmod.widget.AutoCollapseTextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{rate.toString()}"
                tools:text="▲ 3.23KB/s\t\t▼ 5.12GB/s"/>
        </LinearLayout>
    </LinearLayout>
</layout>
