<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/milestoneFrame"
    android:paddingTop="@dimen/dimen4dp"
    android:paddingBottom="@dimen/dimen4dp">

    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="?attr/materialCardViewElevatedStyle"
        app:cardElevation="@dimen/dimen0dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:foreground="?android:attr/selectableItemBackground"
            android:background="?attr/materialCardBackgroundColor"
            android:padding="@dimen/dimen12dp"
            android:orientation="vertical">

            <LinearLayout
                android:id="@+id/frameTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/milestoneTitle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:textColor="?attr/primaryTextColor"
                    android:textIsSelectable="true"
                    android:textSize="16sp"/>

                <ProgressBar
                    android:id="@+id/milestoneProgress"
                    style="@style/Widget.AppCompat.ProgressBar.Horizontal"
                    android:layout_width="0dp"
                    android:layout_height="10dp"
                    android:layout_marginStart="15dp"
                    android:layout_marginEnd="10dp"
                    android:layout_weight="1"
                    android:indeterminate="false"
                    android:progress="50"
                    android:progressDrawable="@drawable/progress_bar"
                    android:progressTint="?attr/fabColor" />

            </LinearLayout>

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

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_marginEnd="15dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    tools:ignore="UseCompoundDrawables">

                    <ImageView
                        android:layout_width="18dp"
                        android:layout_height="wrap_content"
                        android:layout_marginEnd="5dp"
                        android:contentDescription="@string/generalImgContentText"
                        app:srcCompat="@drawable/ic_calendar"/>

                    <TextView
                        android:id="@+id/milestoneDueDate"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/dueDate"
                        android:textColor="?attr/primaryTextColor"
                        android:textSize="14sp"/>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_marginEnd="15dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    tools:ignore="UseCompoundDrawables">

                    <ImageView
                        android:layout_width="18dp"
                        android:layout_height="wrap_content"
                        android:layout_marginEnd="5dp"
                        android:contentDescription="@string/generalImgContentText"
                        app:srcCompat="@drawable/ic_issue"/>

                    <TextView
                        android:id="@+id/milestoneIssuesOpen"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/repoStars"
                        android:textColor="?attr/primaryTextColor"
                        android:textSize="14sp"/>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    tools:ignore="UseCompoundDrawables">

                    <ImageView
                        android:layout_width="18dp"
                        android:layout_height="wrap_content"
                        android:layout_marginEnd="5dp"
                        android:contentDescription="@string/generalImgContentText"
                        app:srcCompat="@drawable/ic_issue_closed"/>

                    <TextView
                        android:id="@+id/milestoneIssuesClosed"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/repoWatchers"
                        android:textColor="?attr/primaryTextColor"
                        android:textSize="14sp"/>
                </LinearLayout>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/milestoneDateMenuFrame"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:orientation="horizontal">

                <RelativeLayout
                    android:id="@+id/dueDateFrame"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dp"
                    android:layout_weight=".90"
                    android:orientation="horizontal">

                    <TextView
                        android:id="@+id/milestoneDescription"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/repoDescription"
                        android:textColor="?attr/primaryTextColor"
                        android:textIsSelectable="true"
                        android:textSize="14sp"
                        android:visibility="visible"/>

                </RelativeLayout>

                <ImageView
                    android:id="@+id/milestonesMenu"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="end|bottom"
                    android:contentDescription="@string/menuContentDesc"
                    android:background="?android:attr/selectableItemBackgroundBorderless"
                    android:scaleType="fitEnd"
                    android:src="@drawable/ic_dotted_menu_horizontal"/>

            </LinearLayout>

        </LinearLayout>

    </com.google.android.material.card.MaterialCardView>

</RelativeLayout>
