<?xml version="1.0" encoding="utf-8"?>

<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:tools="http://schemas.android.com/tools"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/coordinatorLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:context=".VictoryActivity">

        <TextView
                android:id="@+id/congrats"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginTop="32dp"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:text="@string/congrats"
                android:textAppearance="@style/TextAppearance.AppCompat.Headline"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

        <TextView
                android:id="@+id/player1NameTextView"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="8dp"
                android:layout_marginRight="8dp"
                android:layout_marginBottom="8dp"
                android:layout_weight="1"
                android:text="@string/player_1_default_name"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                app:layout_constraintBottom_toTopOf="@+id/previousMatchesTextView"
                app:layout_constraintEnd_toStartOf="@+id/scoreTextView"
                app:layout_constraintTop_toBottomOf="@+id/congrats" />

        <TextView
                android:id="@+id/scoreTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="8dp"
                android:layout_marginRight="8dp"
                android:layout_marginBottom="8dp"
                android:layout_weight="0"
                android:text="@string/score"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                app:layout_constraintBottom_toTopOf="@+id/previousMatchesTextView"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/congrats" />

        <TextView
                android:id="@+id/player2NameTextView"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginLeft="8dp"
                android:layout_marginTop="8dp"
                android:layout_marginBottom="8dp"
                android:layout_weight="1"
                android:text="@string/player_2_default_name"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                app:layout_constraintBottom_toTopOf="@+id/previousMatchesTextView"
                app:layout_constraintStart_toEndOf="@+id/scoreTextView"
                app:layout_constraintTop_toBottomOf="@+id/congrats" />

        <TextView
                android:id="@+id/previousMatchesTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:text="@string/previous_matches"
                android:textAllCaps="true"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/player1NameTextView" />

        <GridView
                android:id="@+id/previousMatchesGrid"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:layout_marginBottom="8dp"
                android:clickable="false"
                android:gravity="center"
                android:numColumns="3"
                app:layout_constraintBottom_toTopOf="@+id/pingPointsCredit"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/previousMatchesTextView">

        </GridView>

        <TextView
                android:id="@+id/pingPointsCredit"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:layout_weight="0"
                android:text="@string/PingPointsCredits"
                app:layout_constraintBottom_toTopOf="@+id/iconsCredit"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/previousMatchesGrid" />

        <TextView
                android:id="@+id/iconsCredit"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:layout_marginBottom="24dp"
                android:layout_weight="0"
                android:maxLines="1"
                android:text="@string/iconCredits"
                app:layout_constraintBottom_toTopOf="@+id/buttonShare"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="1.0"
                app:layout_constraintStart_toStartOf="parent" />

        <Button
                android:id="@+id/buttonNewMatch"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:layout_marginBottom="32dp"
                android:drawableStart="@drawable/ic_new_match"
                android:drawableLeft="@drawable/ic_new_match"
                android:onClick="newMatch"
                android:text="@string/new_match"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent" />

        <Button
                android:id="@+id/buttonShare"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginBottom="32dp"
                android:drawableStart="@drawable/ic_share"
                android:drawableLeft="@drawable/ic_share"
                android:onClick="share"
                android:text="@string/share"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintStart_toStartOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>