<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginHorizontal="8dp"
    android:layout_marginVertical="4dp"
    android:descendantFocusability="blocksDescendants">
    <!--
     descendantFocusability is here because if you have a child that responds
     to touch events (in our case, the switch/toggle button) then the list item
     itself will not respond to touch events.
     http://syedasaraahmed.wordpress.com/2012/10/03/android-onitemclicklistener-not-responding-clickable-rowitem-of-custom-listview/
    -->

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/selectableItemBackground"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:padding="8dp">

        <ImageView
            android:id="@+id/repo_icon"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_marginEnd="8dp"
            android:importantForAccessibility="no"
            android:scaleType="fitCenter"
            tools:src="@tools:sample/avatars" />

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:orientation="vertical"
            tools:ignore="RtlSymmetry">

            <TextView
                android:id="@+id/repo_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="marquee"
                android:gravity="center_vertical|start"
                android:singleLine="true"
                android:textAppearance="?attr/textAppearanceListItem"
                tools:text="This is the name of the Repo as taken from the index. It can be long." />

            <TextView
                android:id="@+id/repo_address"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:gravity="center_vertical|start"
                android:singleLine="true"
                android:textSize="14sp"
                tools:text="this.is.a.repo.at.the.official.domain.it.can.be.long.at.f-droid.org" />

            <TextView
                android:id="@+id/repo_unverified"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:gravity="center_vertical|start"
                android:singleLine="true"
                android:text="@string/unverified"
                android:textColor="@color/unverified"
                android:textSize="14sp"
                tools:visibility="visible" />

            <TextView
                android:id="@+id/repo_unsigned"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:gravity="center_vertical|start"
                android:singleLine="true"
                android:text="@string/unsigned"
                android:textColor="@color/unsigned"
                android:textSize="14sp"
                tools:visibility="gone" />

        </LinearLayout>

        <com.google.android.material.switchmaterial.SwitchMaterial
            android:id="@+id/repo_switch"
            android:layout_width="wrap_content"
            android:layout_height="match_parent" />

    </LinearLayout>

</androidx.cardview.widget.CardView>
