<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.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=".MainActivity"> <ImageView android:id="@+id/image_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitStart" app:layout_constraintTop_toBottomOf="parent" app:layout_constraintBottom_toTopOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" android:contentDescription="Select image for text recognition" /> <com.hoineki.mlkittext.GraphicOverlay android:id="@+id/graphic_overlay" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" /> <Button android:id="@+id/show_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Show Text" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintBottom_toTopOf="@id/spinner" /> <Spinner android:id="@+id/spinner" android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintBottom_toTopOf="@id/button_text" android:background="@android:drawable/btn_dropdown" android:spinnerMode="dropdown" /> <Button android:id="@+id/button_text" android:text="Find text" android:layout_width="0dp" android:layout_height="wrap_content" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toLeftOf="@id/button_cloud_text" app:layout_constraintBottom_toBottomOf="parent"/> <Button android:id="@+id/button_cloud_text" android:layout_width="0dp" android:text="Find text (cloud)" android:layout_height="wrap_content" app:layout_constraintLeft_toRightOf="@id/button_text" app:layout_constraintRight_toRightOf="parent" app:layout_constraintBottom_toBottomOf="parent"/> </android.support.constraint.ConstraintLayout>