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

<android.support.design.widget.CoordinatorLayout
        xmlns:tools="http://schemas.android.com/tools" android:id="@+id/coordinatorLayout"
        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.support.constraint.ConstraintLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:context=".VictoryActivity">

        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/congrats"
                android:textAppearance="@style/TextAppearance.AppCompat.Headline"
                android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent"
                android:layout_marginRight="8dp" android:layout_marginStart="8dp"
                app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp"
                android:text="@string/congrats" android:layout_marginTop="8dp"
                app:layout_constraintTop_toTopOf="parent"/>
        <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" app:layout_constraintTop_toBottomOf="@+id/congrats"
                android:id="@+id/resultLinearLayout" android:layout_marginTop="8dp"
                app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp"
                android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent"
                android:layout_marginEnd="8dp" android:layout_marginRight="8dp" android:layout_marginBottom="8dp"
                app:layout_constraintBottom_toTopOf="@+id/previousMatchesTextView">
            <TextView
                    android:text="@string/player_1_default_name"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:id="@+id/player1NameTextView"
                    android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                    android:gravity="right" tools:layout_editor_absoluteX="8dp" android:layout_weight="1"/>
            <TextView
                    android:text="@string/score"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" android:id="@+id/scoreTextView"
                    android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                    android:layout_marginStart="24dp"
                    android:layout_marginLeft="24dp" android:layout_weight="0" android:layout_marginRight="24dp"/>
            <TextView
                    android:text="@string/player_2_default_name"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:id="@+id/player2NameTextView"
                    android:layout_marginLeft="24dp" android:layout_marginStart="24dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:layout_marginEnd="8dp"
                    android:layout_marginRight="8dp" android:gravity="left"
                    android:layout_weight="1"/>
        </LinearLayout>
        <TextView
                android:text="@string/previous_matches"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAllCaps="true"
                android:id="@+id/previousMatchesTextView"
                app:layout_constraintStart_toStartOf="parent"
                android:layout_marginLeft="8dp" android:layout_marginStart="8dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@id/resultLinearLayout"
                android:layout_marginEnd="8dp"
                android:layout_marginRight="8dp" android:layout_marginTop="32dp"/>
        <GridView
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_marginTop="8dp"
                app:layout_constraintTop_toBottomOf="@id/previousMatchesTextView"
                android:numColumns="3" android:id="@+id/previousMatchesGrid" android:clickable="false"
                android:gravity="center"
                app:layout_constraintStart_toStartOf="parent"
                android:layout_marginLeft="16dp" android:layout_marginStart="16dp"
                android:layout_marginEnd="16dp" app:layout_constraintEnd_toEndOf="parent"
                android:layout_marginRight="16dp" android:layout_marginBottom="8dp"
                app:layout_constraintBottom_toTopOf="@+id/button3"/>
        <Button
                android:text="@string/new_match"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/button3" app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
                android:layout_marginRight="8dp" android:layout_marginBottom="8dp"
                app:layout_constraintBottom_toBottomOf="parent" android:drawableStart="@drawable/ic_new_match"
                android:drawableLeft="@drawable/ic_new_match"
                android:onClick="newMatch"/>
        <Button
                android:text="@string/share"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/button4" android:layout_marginBottom="8dp"
                app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent"
                android:layout_marginLeft="8dp" android:layout_marginStart="8dp"
                android:drawableStart="@drawable/ic_share" android:onClick="share"/>

    </android.support.constraint.ConstraintLayout>

</android.support.design.widget.CoordinatorLayout>