<?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:background="@color/gbaBackground"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include
        android:id="@+id/include"
        layout="@layout/dpad"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginBottom="64dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <com.mrmichel.rustdroid_emu.ui.ScreenView
        android:id="@+id/gba_view"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="32dp"
        app:layout_constraintDimensionRatio="H, 3:2"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.517"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/buttonB"
        style="@style/Widget.AppCompat.Button.Small"
        android:layout_width="52dp"
        android:layout_height="54dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="12dp"
        android:background="@drawable/round_button"
        android:text="B"
        app:layout_constraintEnd_toStartOf="@+id/buttonA"
        app:layout_constraintTop_toTopOf="@+id/include"
        tools:text="B" />

    <Button
        android:id="@+id/buttonA"
        style="@style/Widget.AppCompat.Button.Small"
        android:layout_width="52dp"
        android:layout_height="54dp"
        android:layout_marginEnd="24dp"
        android:background="@drawable/round_button"
        android:text="A"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@+id/include"
        tools:text="A" />

    <Button
        android:id="@+id/bSelect"
        style="@style/Widget.AppCompat.Button.Small"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="120dp"
        android:layout_marginEnd="12dp"
        android:layout_marginBottom="16dp"
        android:background="@drawable/round_button"
        android:text="select"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/bStart"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="@+id/include" />

    <Button
        android:id="@+id/bStart"
        style="@style/Widget.AppCompat.Button.Small"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="12dp"
        android:layout_marginBottom="16dp"
        android:background="@drawable/round_button"
        android:text="start"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toEndOf="@+id/bSelect" />

    <Button
        android:id="@+id/buttonL"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="2dp"
        android:layout_marginTop="24dp"
        android:text="L"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/gba_view" />

    <Button
        android:id="@+id/buttonR"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:layout_marginEnd="2dp"
        android:text="R"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/gba_view" />

    <Switch
        android:id="@+id/tbTurbo"
        android:layout_width="98dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="24dp"
        android:layout_marginBottom="16dp"
        android:checked="false"
        android:text="Turbo Mode"
        android:textOff="Turbo OFF"
        android:textOn="Turbo ON"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <TextView
        android:id="@+id/tvFPS"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        app:layout_constraintTop_toBottomOf="@+id/gba_view"
        tools:layout_editor_absoluteX="176dp" />

</androidx.constraintlayout.widget.ConstraintLayout>
