<?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"
    android:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:keepScreenOn="true">

  <ImageView
      android:id="@+id/preview"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:adjustViewBounds="true"
      app:layout_constraintBottom_toTopOf="@+id/control"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent" />

  <com.google.mlkit.vision.demo.GraphicOverlay
      android:id="@+id/graphic_overlay"
      android:layout_width="0dp"
      android:layout_height="0dp"
      app:layout_constraintLeft_toLeftOf="@id/preview"
      app:layout_constraintRight_toRightOf="@id/preview"
      app:layout_constraintTop_toTopOf="@id/preview"
      app:layout_constraintBottom_toBottomOf="@id/preview"/>

  <LinearLayout
      android:id="@id/control"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      app:layout_constraintBottom_toBottomOf="parent"
      android:background="#000"
      android:orientation="vertical">

    <Button
        android:id="@+id/select_image_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="12dp"
        android:text="@string/select_image"/>

    <LinearLayout
        android:id="@+id/control2"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        app:layout_constraintBottom_toBottomOf="parent"
        android:background="#000"
        android:orientation="horizontal">

      <Spinner
          android:id="@+id/size_selector"
          android:layout_width="0dp"
          android:layout_weight="1"
          android:layout_height="wrap_content"
          android:layout_gravity="center"/>

      <Spinner
          android:id="@+id/feature_selector"
          android:layout_width="0dp"
          android:layout_weight="1"
          android:layout_height="wrap_content"
          android:layout_gravity="center"/>
    </LinearLayout>
  </LinearLayout>

  <include
      layout="@layout/settings_style"
      android:id="@+id/settings_button"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:layout_constraintRight_toRightOf="@id/root"
      app:layout_constraintTop_toTopOf="@id/root"/>

</androidx.constraintlayout.widget.ConstraintLayout>
