<?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/parent_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.camera.view.PreviewView
        android:id="@+id/camera_preview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"/>

    <View
        android:id="@+id/border_frame_top"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="?attr/colorSurface"
        app:layout_constraintBottom_toTopOf="@+id/camera_preview_container"
        app:layout_constraintTop_toTopOf="parent" />

    <View
        android:id="@+id/border_frame_bottom"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="?attr/colorSurface"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/camera_preview_container" />

    <View
        android:id="@+id/border_frame_left"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="?attr/colorSurface"
        app:layout_constraintBottom_toTopOf="@id/border_frame_bottom"
        app:layout_constraintEnd_toStartOf="@+id/camera_preview_container"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/border_frame_top" />

    <View
        android:id="@+id/border_frame_right"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="?attr/colorSurface"
        app:layout_constraintBottom_toTopOf="@id/border_frame_bottom"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@+id/camera_preview_container"
        app:layout_constraintTop_toBottomOf="@id/border_frame_top" />

    <LinearLayout
        android:id="@+id/explain_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:orientation="vertical"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@+id/camera_preview_container">

        <TextView
            android:id="@+id/title"
            style="@style/Threema.TextAppearance.Title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:text="@string/scan_qr_code" />

        <TextView
            android:id="@+id/body"
            style="@style/Threema.TextAppearance.BodyMedium"
            android:layout_marginTop="16dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:text="@string/scan_qr_code_explain" />

    </LinearLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/camera_preview_container"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginLeft="75dp"
        android:layout_marginBottom="75dp"
        android:layout_marginRight="75dp"
        android:layout_marginTop="16dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/explain_layout"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintDimensionRatio="1:1"/>

</androidx.constraintlayout.widget.ConstraintLayout>
