<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".TestColdStartLatencyActivity">

    <LinearLayout
        android:id="@+id/buttonGrid"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <RadioGroup
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checkedButton="@+id/direction_output"
            android:orientation="horizontal">

            <RadioButton
                android:id="@+id/direction_output"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Output" />

            <RadioButton
                android:id="@+id/direction_input"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Input" />
        </RadioGroup>


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

            <CheckBox
                android:id="@+id/checkbox_mmap"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="8sp"
                android:text="MMAP"
                android:checked="true" />

            <CheckBox
                android:id="@+id/checkbox_low_latency"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="8sp"
                android:text="LOW_LATENCY"
                android:checked="true" />

            <CheckBox
                android:id="@+id/checkbox_exclusive"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="8sp"
                android:text="EXCLUSIVE"
                android:checked="true" />
        </LinearLayout>

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

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/start_stabilize_prompt" />

            <Spinner
                android:id="@+id/spinner_start_stabilize_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:entries="@array/sleep_times" />

        </LinearLayout>

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

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/close_open_prompt" />

            <Spinner
                android:id="@+id/spinner_close_open_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:entries="@array/sleep_times" />

        </LinearLayout>

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

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/open_start_prompt" />

            <Spinner
                android:id="@+id/spinner_open_start_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:entries="@array/sleep_times" />

        </LinearLayout>

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

            <Button
                android:id="@+id/button_start_test"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:backgroundTint="@color/button_tint"
                android:onClick="onStartColdStartLatencyTest"
                android:text="Start Test" />
            <Button
                android:id="@+id/button_stop_test"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:backgroundTint="@color/button_tint"
                android:onClick="onStopColdStartLatencyTest"
                android:text="Stop Test" />
        </LinearLayout>

        <ScrollView
            android:id="@+id/text_log_scroller"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <TextView
                android:id="@+id/text_status"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fontFamily="monospace"
                android:gravity="bottom"
                android:scrollbars="vertical"
                android:text="@string/init_status" />
        </ScrollView>

    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
