<?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=".CameraActivity"> <Button android:id="@+id/button_camera" android:layout_width="100dp" android:layout_height="100dp" android:layout_marginBottom="48dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:background="@drawable/focus_marker_outline" app:layout_constraintBottom_toBottomOf="@+id/camera" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> <com.otaliastudios.cameraview.CameraView android:id="@+id/camera" android:layout_width="match_parent" android:layout_height="match_parent" android:keepScreenOn="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> </com.otaliastudios.cameraview.CameraView> </android.support.constraint.ConstraintLayout>