<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<RelativeLayout 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"
    android:id="@+id/add_on_item"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?android:attr/selectableItemBackground"
    android:orientation="horizontal"
    android:paddingStart="16dp"
    android:paddingEnd="0dp">

    <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/add_on_icon"
        style="@style/Mozac.Widgets.Favicon"
        tools:ignore="RequiredSize"
        android:layout_alignParentStart="true"
        android:layout_marginTop="16dp"
        android:importantForAccessibility="no"
        app:srcCompat="@android:color/transparent" />

    <LinearLayout
        android:id="@+id/details_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:layout_marginBottom="8dp"
        android:layout_toStartOf="@+id/add_button"
        android:layout_toEndOf="@+id/add_on_icon"
        android:orientation="vertical"
        android:paddingStart="8dp"
        android:paddingTop="8dp"
        android:paddingEnd="4dp"
        android:paddingBottom="8dp">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/add_on_name_container_margin_bottom"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/add_on_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_weight="1"
                android:ellipsize="end"
                android:maxLines="1"
                android:textSize="16sp"
                tools:text="uBlock Origin" />

            <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/allowed_in_private_browsing_label"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginStart="@dimen/allowed_in_private_browsing_label_margins"
                android:layout_marginEnd="@dimen/allowed_in_private_browsing_label_margins"
                android:layout_weight="0"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:visibility="gone" />

        </LinearLayout>

        <TextView
            android:id="@+id/add_on_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="14sp"
            tools:text="An efficient blocker: easy on memory and CPU footprint, and yet can load and enforce thousands more filters than other popular blockers out there." />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:orientation="horizontal">

            <RatingBar
                android:id="@+id/rating"
                style="@style/Widget.AppCompat.RatingBar.Small"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:importantForAccessibility="no"
                android:layout_gravity="center_vertical"
                android:isIndicator="true"
                android:numStars="5" />

            <TextView
                android:id="@+id/rating_accessibility"
                android:layout_width="0dp"
                android:layout_height="0dp" />

            <TextView
                android:id="@+id/users_count"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="6dp"
                android:textSize="12sp"
                android:layout_gravity="center_vertical"
                tools:text="Reviews: 591,642" />

        </LinearLayout>

    </LinearLayout>

    <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/add_button"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:scaleType="center"
        android:layout_marginStart="0dp"
        android:layout_marginEnd="6dp"
        android:layout_alignParentEnd="true"
        android:layout_centerVertical="true"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/mozac_feature_addons_install_addon_content_description"
        app:srcCompat="@drawable/mozac_ic_new"
        app:tint="?android:attr/textColorPrimary" />
</RelativeLayout>
