<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:fitsSystemWindows="true"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="?attr/primaryBackgroundColor">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/Widget.AppCompat.SearchView">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:layout_weight="1"
            android:background="?attr/primaryBackgroundColor"
            app:popupTheme="@style/AppTheme.PopupOverlay"
            app:title="@string/app_name" >

            <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center_vertical"
                android:gravity="center_vertical"
                android:textSize="18sp"
                android:textColor="?attr/primaryTextColor"
                android:id="@+id/toolbar_title" />

        </androidx.appcompat.widget.Toolbar>

    </com.google.android.material.appbar.AppBarLayout>

    <RelativeLayout
        android:id="@+id/relativeMainLayoutFrame"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
            android:id="@+id/pullToRefresh"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ScrollView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:id="@+id/scrollViewComments"
                android:fillViewport="true">

                <RelativeLayout
                    android:id="@+id/relativeLayoutFrame"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="15dp">

                    <ImageView
                        android:id="@+id/assigneeAvatar"
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:layout_marginEnd="15dp"
                        android:contentDescription="@string/generalImgContentText" />

                    <TextView
                        android:id="@+id/issueTitle"
                        android:layout_toEndOf="@+id/assigneeAvatar"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="start"
                        android:textColor="?attr/primaryTextColor"
                        android:textIsSelectable="true"
                        android:textSize="18sp" />

                    <RelativeLayout
                        android:id="@+id/msdueFrame"
                        android:layout_toEndOf="@+id/assigneeAvatar"
                        android:layout_below="@+id/issueTitle"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="10dp" >

                        <TextView
                            android:id="@+id/issueDueDate"
                            android:gravity="start"
                            android:layout_alignParentStart="true"
                            android:layout_gravity="start"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="?attr/primaryTextColor"
                            android:textSize="14sp" />

                        <TextView
                            android:layout_toEndOf="@+id/issueDueDate"
                            android:id="@+id/issueMilestone"
                            android:gravity="end"
                            android:layout_gravity="end"
                            android:layout_alignParentEnd="true"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="?attr/primaryTextColor"
                            android:textSize="14sp" />

                    </RelativeLayout>

                    <HorizontalScrollView
                        android:layout_below="@+id/msdueFrame"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:id="@+id/assigneesScrollView"
                        android:layout_alignParentEnd="false"
                        android:foregroundGravity="right"
                        android:scrollbarThumbHorizontal="@android:color/transparent"
                        android:fillViewport="true">

                        <LinearLayout
                            android:id="@+id/frameAssignees"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:layout_gravity="end"
                            android:gravity="end"
                            android:layout_marginTop="10dp">

                        </LinearLayout>
                    </HorizontalScrollView>

                    <TextView
                        android:id="@+id/issueDescription"
                        android:layout_below="@+id/assigneesScrollView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="start"
                        android:textColor="?attr/primaryTextColor"
                        android:autoLink="web"
                        android:textColorLink="@color/lightBlue"
                        android:textIsSelectable="true"
                        android:textSize="16sp" />

                    <HorizontalScrollView
                        android:layout_below="@+id/issueDescription"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:id="@+id/labelsScrollView"
                        android:layout_alignParentEnd="false"
                        android:foregroundGravity="right"
                        android:scrollbarThumbHorizontal="@android:color/transparent"
                        android:fillViewport="true">

                        <LinearLayout
                            android:id="@+id/frameLabels"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:layout_marginTop="10dp">

                        </LinearLayout>
                    </HorizontalScrollView>

                    <RelativeLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:id="@+id/issueTimeFrame"
                        android:layout_below="@+id/labelsScrollView"
                        android:orientation="horizontal"
                        android:layout_marginTop="10dp">

                        <TextView
                            android:id="@+id/issueCreatedTime"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="start"
                            android:text="@string/createdText"
                            android:visibility="gone"
                            android:textColor="?attr/primaryTextColor"
                            android:textSize="12sp" />

                        <TextView
                            android:id="@+id/issueModified"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="?attr/primaryTextColor"
                            android:layout_toEndOf="@+id/issueCreatedTime"
                            android:textSize="12sp"
                            android:visibility="gone"
                            android:text="@string/modifiedText" />

                    </RelativeLayout>

                    <View
                        android:layout_below="@id/issueTimeFrame"
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:id="@+id/divider"
                        android:layout_marginTop="15dp"
                        android:background="?attr/inputBackgroundColor" />

                    <androidx.recyclerview.widget.RecyclerView
                        android:layout_below="@+id/divider"
                        android:id="@+id/recyclerView"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:background="?attr/primaryBackgroundColor"
                        android:padding="4dp"
                        android:scrollbars="vertical" />

                </RelativeLayout>

            </ScrollView>

        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

        <ImageView
            android:id="@+id/addNewComment"
            android:src="@drawable/ic_reply"
            android:tint="@color/white"
            android:layout_width="54dp"
            android:layout_height="54dp"
            android:layout_margin="15dp"
            android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true"
            android:background="@drawable/circle"
            android:padding="@dimen/fab_padding"
            android:contentDescription="@string/addNewContent" />

    </RelativeLayout>

</LinearLayout>