<?xml version="1.0" encoding="utf-8"?><!--
  ~ Aurora Store
  ~  Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com>
  ~
  ~  Aurora Store is free software: you can redistribute it and/or modify
  ~  it under the terms of the GNU General Public License as published by
  ~  the Free Software Foundation, either version 2 of the License, or
  ~  (at your option) any later version.
  ~
  ~  Aurora Store is distributed in the hope that it will be useful,
  ~  but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~  GNU General Public License for more details.
  ~
  ~  You should have received a copy of the GNU General Public License
  ~  along with Aurora Store.  If not, see <http://www.gnu.org/licenses/>.
  ~
  -->

<LinearLayout 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:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:divider="@drawable/divider"
    android:orientation="vertical"
    android:paddingStart="@dimen/padding_small"
    android:paddingEnd="@dimen/padding_small"
    android:showDividers="middle">

    <com.aurora.store.view.custom.layouts.ActionHeaderLayout
        android:id="@+id/header_rating_reviews"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:headerTitle="@string/details_ratings" />

    <LinearLayout
        android:id="@+id/layout_user_review"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:orientation="vertical">

        <RatingBar
            android:id="@+id/user_stars"
            style="@style/Widget.AppCompat.RatingBar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:numStars="5"
            android:scaleX=".75"
            android:scaleY=".75"
            android:stepSize="1" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="@dimen/margin_normal"
            android:divider="@drawable/divider"
            android:orientation="vertical"
            android:showDividers="middle">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/input_title"
                android:layout_width="match_parent"
                android:layout_height="42dp"
                android:background="@drawable/bg_changelog"
                android:gravity="center_vertical|center_horizontal"
                android:hint="@string/details_ratings_title_hint"
                android:imeOptions="flagNoExtractUi|actionDone"
                android:inputType="text"
                android:paddingStart="@dimen/padding_large"
                android:paddingEnd="@dimen/padding_normal"
                android:singleLine="true"
                android:textAppearance="@style/TextAppearance.Aurora.Line2" />

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/input_review"
                android:layout_width="match_parent"
                android:layout_height="42dp"
                android:background="@drawable/bg_changelog"
                android:gravity="center_vertical|center_horizontal"
                android:hint="@string/details_think_this_app"
                android:imeOptions="flagNoExtractUi|actionDone"
                android:inputType="text"
                android:paddingStart="@dimen/padding_large"
                android:paddingEnd="@dimen/padding_normal"
                android:singleLine="true"
                android:textAppearance="@style/TextAppearance.Aurora.Line2" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btn_post_review"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:text="@string/action_post"
                app:cornerRadius="@dimen/margin_small" />
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:baselineAligned="false"
        android:weightSum="4">

        <RelativeLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:orientation="vertical"
            android:padding="@dimen/padding_small">

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/average_rating"
                style="@style/AuroraTextStyle.Rating"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_gravity="center_horizontal"
                android:gravity="center"
                android:maxLines="1"
                tools:text="4.5" />

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/txt_review_count"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/average_rating"
                android:layout_centerHorizontal="true"
                android:textAlignment="center"
                android:textAppearance="@style/TextAppearance.Aurora.Line3"
                android:translationY="-8dp"
                tools:text="512" />
        </RelativeLayout>

        <LinearLayout
            android:id="@+id/avg_rating_layout"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="3"
            android:divider="@drawable/divider"
            android:orientation="vertical"
            android:showDividers="middle" />
    </LinearLayout>

    <com.airbnb.epoxy.EpoxyRecyclerView
        android:id="@+id/epoxy_recycler"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:overScrollMode="never"
        android:scrollbars="none"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        tools:itemCount="4"
        tools:listitem="@layout/view_review" />
</LinearLayout>