<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <View
        android:id="@+id/stopwatch_background"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="@color/primary"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintDimensionRatio="16:9"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0" />

    <ImageButton
        android:id="@+id/clear"
        android:layout_width="@dimen/button_size"
        android:layout_height="@dimen/button_size"
        android:layout_margin="@dimen/spacing_medium"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/clear"
        android:src="@drawable/ic_refresh_24dp"
        app:layout_constraintBottom_toBottomOf="@id/stopwatch_background"
        app:layout_constraintStart_toStartOf="@id/stopwatch_background"
        app:layout_constraintTop_toTopOf="@id/stopwatch_background"
        app:tint="@android:color/white" />

    <ImageButton
        android:id="@+id/start_or_pause"
        android:layout_width="@dimen/button_size"
        android:layout_height="@dimen/button_size"
        android:layout_margin="@dimen/spacing_medium"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:contentDescription="@string/start"
        android:src="@drawable/ic_play_arrow_24dp"
        app:layout_constraintBottom_toBottomOf="@id/stopwatch_background"
        app:layout_constraintEnd_toEndOf="@id/stopwatch_background"
        app:layout_constraintTop_toTopOf="@id/stopwatch_background"
        app:tint="@android:color/white" />

    <TextView
        android:id="@+id/time"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_margin="@dimen/spacing_medium"
        android:autoSizeTextType="uniform"
        android:gravity="center"
        android:maxLines="1"
        android:textColor="@android:color/white"
        app:layout_constraintBottom_toBottomOf="@id/stopwatch_background"
        app:layout_constraintEnd_toStartOf="@id/start_or_pause"
        app:layout_constraintStart_toEndOf="@id/clear"
        app:layout_constraintTop_toTopOf="@id/stopwatch_background"
        tools:targetApi="26"
        tools:text="12:34:56" />

    <ScrollView
        android:id="@+id/scroll"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/stopwatch_background">

        <LinearLayout
            android:id="@+id/scroll_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="@dimen/spacing_medium">

            <Button
                android:id="@+id/pip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableStart="@drawable/ic_picture_in_picture_alt"
                android:drawablePadding="@dimen/spacing_medium"
                android:text="@string/enter_picture_in_picture"
                app:drawableTint="@android:color/black"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/stopwatch_background" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/spacing_medium"
                android:hyphenationFrequency="normal"
                android:justificationMode="inter_word"
                android:text="@string/explanation_main"
                android:textAppearance="@style/TextAppearance.AppCompat.Body1"
                tools:targetApi="26" />

        </LinearLayout>

    </ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>
