<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
        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:minHeight="?android:attr/listPreferredItemHeight"
        android:paddingBottom="2dip"
        android:paddingTop="2dip">

    <ImageView
            android:id="@android:id/icon"
            android:layout_width="48dip"
            android:layout_height="48dip"
            android:layout_marginStart="?android:attr/listPreferredItemPaddingStart"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="6dip"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            tools:src="@drawable/ic_launcher"/>

    <LinearLayout
            android:id="@+id/button_or_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_centerInParent="true"
            android:orientation="vertical"
            android:gravity="end"
            android:layout_marginEnd="?android:attr/listPreferredItemPaddingEnd"
            android:layout_marginRight="10dp">

        <Button
                android:id="@+id/btn_install"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:backgroundTint="@color/swap_light_blue"
                android:textColor="@android:color/white"
                android:maxEms="10"
                android:ellipsize="end"
                android:singleLine="true"
                android:text="@string/menu_install"
                tools:ignore="UnusedAttribute"/>

        <TextView
                android:id="@+id/status_installed"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textStyle="italic"
                android:text="@string/app_installed"/>

        <TextView
                android:id="@+id/status_incompatible"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textStyle="italic"
                android:textColor="@color/swap_incompatible"
                android:text="@string/app_incompatible"/>

    </LinearLayout>

    <TextView
            android:id="@+id/name"
            android:layout_toEndOf="@android:id/icon"
            android:layout_toRightOf="@android:id/icon"
            android:layout_toStartOf="@+id/button_or_text"
            android:layout_toLeftOf="@+id/button_or_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="?android:attr/listPreferredItemPaddingStart"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="6dip"
            android:layout_marginBottom="6dip"
            android:textAppearance="?android:attr/textAppearanceMedium"
            tools:text="F-Droid"/>

    <ProgressBar
            android:id="@+id/progress"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:indeterminate="true"
            style="?android:attr/progressBarStyleHorizontal"
            android:paddingStart="5dp"
            android:paddingLeft="5dp"
            android:paddingEnd="5dp"
            android:paddingRight="5dp"
            android:layout_toEndOf="@android:id/icon"
            android:layout_toRightOf="@android:id/icon"
            android:layout_toStartOf="@+id/button_or_text"
            android:layout_toLeftOf="@+id/button_or_text"
            android:layout_below="@+id/name"
    />

</RelativeLayout>
