<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?attr/primaryBackgroundColor">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginTop="@dimen/dimen16dp"
        android:padding="@dimen/dimen16dp">

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

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:text="@string/home"
                android:textSize="@dimen/dimen20sp"
                android:layout_weight="1"
                android:textColor="?attr/primaryTextColor" />

            <com.google.android.material.card.MaterialCardView
                android:layout_width="@dimen/dimen36dp"
                android:layout_height="@dimen/dimen36dp"
                app:cardCornerRadius="@dimen/dimen12dp"
                app:cardElevation="@dimen/dimen0dp"
                app:strokeWidth="@dimen/dimen0dp"
                app:cardBackgroundColor="?attr/materialCardBackgroundColor">

                <ImageView
                    android:id="@+id/refreshButton"
                    android:layout_width="@dimen/dimen22dp"
                    android:layout_height="@dimen/dimen22dp"
                    android:src="@drawable/ic_refresh"
                    app:tint="?attr/iconsColor"
                    android:layout_gravity="center"
                    android:contentDescription="@string/refresh" />

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

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:weightSum="2">

            <!-- User Info Card -->
            <com.google.android.material.card.MaterialCardView
                android:layout_width="0dp"
                android:layout_height="@dimen/dimen108dp"
                android:layout_weight="1.75"
                android:layout_marginEnd="@dimen/dimen4dp"
                app:cardCornerRadius="@dimen/dimen16dp"
                app:cardElevation="@dimen/dimen0dp"
                app:strokeWidth="@dimen/dimen0dp"
                app:cardBackgroundColor="?attr/materialCardBackgroundColor">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:padding="@dimen/dimen16dp"
                    android:gravity="start|top">

                    <com.google.android.material.card.MaterialCardView
                        android:layout_width="@dimen/dimen76dp"
                        android:layout_height="@dimen/dimen76dp"
                        android:layout_marginEnd="@dimen/dimen8dp"
                        app:cardCornerRadius="@dimen/dimen16dp"
                        app:cardElevation="@dimen/dimen0dp"
                        app:strokeWidth="@dimen/dimen0dp">

                        <ImageView
                            android:id="@+id/userAvatar"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:contentDescription="@string/generalImgContentText"
                            android:src="@drawable/loader_animated" />

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

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="@dimen/dimen8dp"
                        android:layout_marginEnd="@dimen/dimen8dp"
                        android:orientation="vertical">

                        <TextView
                            android:id="@+id/userFullname"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="?attr/primaryTextColor"
                            android:textSize="@dimen/dimen18sp"
                            android:textIsSelectable="true" />

                        <TextView
                            android:id="@+id/userEmail"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="@dimen/dimen4dp"
                            android:textColor="?attr/primaryTextColor"
                            android:textSize="@dimen/dimen14sp"
                            android:textIsSelectable="true"
                            android:visibility="gone" />

                    </LinearLayout>

                </LinearLayout>

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

            <!-- Accounts Container -->
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="0.25"
                android:layout_marginStart="@dimen/dimen8dp"
                android:orientation="vertical">

                <!-- Accounts Card -->
                <com.google.android.material.card.MaterialCardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/dimen0dp"
                    app:cardCornerRadius="@dimen/dimen12dp"
                    app:cardElevation="@dimen/dimen0dp"
                    app:strokeWidth="@dimen/dimen0dp"
                    app:cardBackgroundColor="?attr/materialCardBackgroundColor">

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/userAccountsRecyclerView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

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

            </LinearLayout>

        </LinearLayout>

        <!-- Repository Items -->
        <LinearLayout
            android:id="@+id/repoItemsContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_marginBottom="@dimen/dimen16dp"
            android:layout_marginTop="@dimen/dimen24dp">

            <!-- First Row -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:weightSum="3">

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/repoOrgCard"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dimen84dp"
                    android:layout_weight="1"
                    android:layout_marginHorizontal="@dimen/dimen4dp"
                    app:cardCornerRadius="@dimen/dimen16dp"
                    app:cardElevation="@dimen/dimen0dp"
                    app:strokeWidth="@dimen/dimen0dp"
                    app:cardBackgroundColor="?attr/materialCardBackgroundColor">

                    <TextView
                        android:id="@+id/repoOrgTitle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:padding="@dimen/dimen8dp"
                        android:text="@string/navOrg"
                        android:textColor="?attr/primaryTextColor"
                        android:textSize="@dimen/dimen12sp"
                        android:gravity="center"
                        app:drawableTopCompat="@drawable/ic_organization"
                        android:drawablePadding="@dimen/dimen8dp"
                        android:contentDescription="@string/navOrg" />

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

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/repoActivitiesCard"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dimen84dp"
                    android:layout_weight="1"
                    android:layout_marginHorizontal="@dimen/dimen4dp"
                    app:cardCornerRadius="@dimen/dimen16dp"
                    app:cardElevation="@dimen/dimen0dp"
                    app:strokeWidth="@dimen/dimen0dp"
                    app:cardBackgroundColor="?attr/materialCardBackgroundColor">

                    <TextView
                        android:id="@+id/repoActivitiesIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:padding="@dimen/dimen8dp"
                        android:text="@string/activities"
                        android:textColor="?attr/primaryTextColor"
                        android:textSize="@dimen/dimen12sp"
                        android:gravity="center"
                        app:drawableTopCompat="@drawable/ic_activities"
                        android:drawablePadding="@dimen/dimen8dp"
                        android:contentDescription="@string/activities" />

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

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/repoMyIssuesCard"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dimen84dp"
                    android:layout_weight="1"
                    android:layout_marginHorizontal="@dimen/dimen4dp"
                    app:cardCornerRadius="@dimen/dimen16dp"
                    app:cardElevation="@dimen/dimen0dp"
                    app:strokeWidth="@dimen/dimen0dp"
                    app:cardBackgroundColor="?attr/materialCardBackgroundColor">

                    <TextView
                        android:id="@+id/repoMyIssuesIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:padding="@dimen/dimen8dp"
                        android:text="@string/navMyIssues"
                        android:textColor="?attr/primaryTextColor"
                        android:textSize="@dimen/dimen12sp"
                        android:gravity="center"
                        app:drawableTopCompat="@drawable/ic_issue"
                        android:drawablePadding="@dimen/dimen8dp"
                        android:contentDescription="@string/navMyIssues" />

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

            </LinearLayout>

            <!-- Second Row -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/dimen8dp"
                android:orientation="horizontal"
                android:weightSum="3">

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/repoMyReposCard"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dimen84dp"
                    android:layout_weight="1"
                    android:layout_marginHorizontal="@dimen/dimen4dp"
                    app:cardCornerRadius="@dimen/dimen16dp"
                    app:cardElevation="@dimen/dimen0dp"
                    app:strokeWidth="@dimen/dimen0dp"
                    app:cardBackgroundColor="?attr/materialCardBackgroundColor">

                    <TextView
                        android:id="@+id/repoMyReposIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:padding="@dimen/dimen8dp"
                        android:text="@string/navMyRepos"
                        android:textColor="?attr/primaryTextColor"
                        android:textSize="@dimen/dimen12sp"
                        android:gravity="center"
                        app:drawableTopCompat="@drawable/ic_repo"
                        android:drawablePadding="@dimen/dimen8dp"
                        android:contentDescription="@string/navMyRepos" />

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

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/repoStarredCard"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dimen84dp"
                    android:layout_weight="1"
                    android:layout_marginHorizontal="@dimen/dimen4dp"
                    app:cardCornerRadius="@dimen/dimen16dp"
                    app:cardElevation="@dimen/dimen0dp"
                    app:strokeWidth="@dimen/dimen0dp"
                    app:cardBackgroundColor="?attr/materialCardBackgroundColor">

                    <TextView
                        android:id="@+id/repoStarredIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:padding="@dimen/dimen8dp"
                        android:text="@string/navStarredRepos"
                        android:textColor="?attr/primaryTextColor"
                        android:textSize="@dimen/dimen12sp"
                        android:gravity="center"
                        app:drawableTopCompat="@drawable/ic_star_unfilled"
                        android:drawablePadding="@dimen/dimen2dp"
                        android:contentDescription="@string/navStarredRepos" />

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

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/repoWatchedCard"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dimen84dp"
                    android:layout_weight="1"
                    android:layout_marginHorizontal="@dimen/dimen4dp"
                    app:cardCornerRadius="@dimen/dimen16dp"
                    app:cardElevation="@dimen/dimen0dp"
                    app:strokeWidth="@dimen/dimen0dp"
                    app:cardBackgroundColor="?attr/materialCardBackgroundColor">

                    <TextView
                        android:id="@+id/repoWatchedIcon"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:padding="@dimen/dimen8dp"
                        android:text="@string/navWatchedRepositories"
                        android:textColor="?attr/primaryTextColor"
                        android:textSize="@dimen/dimen12sp"
                        android:gravity="center"
                        app:drawableTopCompat="@drawable/ic_watchers"
                        android:drawablePadding="@dimen/dimen2dp"
                        android:contentDescription="@string/navWatchedRepositories" />

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

            </LinearLayout>

        </LinearLayout>

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/mainScreensRecyclerView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/dimen8dp"
            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

    </LinearLayout>

</androidx.core.widget.NestedScrollView>
