<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ F7cloud Talk - Android Client
  ~
  ~ SPDX-FileCopyrightText: 2021 Andy Scherzinger <info@andy-scherzinger.de>
  ~ SPDX-FileCopyrightText: 2021 Stefan Niedermann <info@niedermann.it>
  ~ SPDX-License-Identifier: GPL-3.0-or-later
-->
<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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/black"
    android:fitsSystemWindows="true"
    tools:theme="@style/TransparentTheme">

    <androidx.camera.view.PreviewView
        android:id="@+id/preview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:scaleType="fitCenter" />

    <com.github.chrisbanes.photoview.PhotoView
        android:id="@+id/photo_preview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:contentDescription="@null"
        android:scaleType="fitCenter"
        android:visibility="invisible" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/toggle_crop"
        style="@style/Widget.AppTheme.Button.IconButton"
        android:layout_width="@dimen/min_size_clickable_area"
        android:layout_height="@dimen/min_size_clickable_area"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true"
        android:layout_marginStart="0dp"
        android:layout_marginTop="12dp"
        android:layout_marginEnd="12dp"
        android:layout_marginBottom="12dp"
        android:contentDescription="@string/take_photo_toggle_crop"
        android:insetLeft="4dp"
        android:insetTop="4dp"
        android:insetRight="4dp"
        android:insetBottom="4dp"
        android:tint="@color/white"
        app:backgroundTint="@color/camera_bg_tint"
        app:cornerRadius="@dimen/button_corner_radius"
        app:elevation="0dp"
        app:icon="@drawable/ic_crop_16_9"
        app:iconGravity="textStart"
        app:iconPadding="0dp"
        app:iconSize="24dp"
        app:iconTint="@color/white"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintEnd_toStartOf="@id/takePhoto"
        app:layout_constraintStart_toStartOf="parent" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/toggle_lowres"
        style="@style/Widget.AppTheme.Button.IconButton"
        android:layout_width="@dimen/min_size_clickable_area"
        android:layout_height="@dimen/min_size_clickable_area"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true"
        android:layout_marginStart="12dp"
        android:layout_marginTop="12dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="12dp"
        android:contentDescription="@string/take_photo_toggle_lowres"
        android:insetLeft="4dp"
        android:insetTop="4dp"
        android:insetRight="4dp"
        android:insetBottom="4dp"
        android:padding="0dp"
        android:tint="@android:color/white"
        app:backgroundTint="@color/camera_bg_tint"
        app:cornerRadius="@dimen/button_corner_radius"
        app:elevation="0dp"
        app:icon="@drawable/ic_low_quality"
        app:iconGravity="textStart"
        app:iconPadding="0dp"
        app:iconSize="24dp"
        app:iconTint="@color/white"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/takePhoto" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/toggle_torch"
        style="@style/Widget.AppTheme.Button.IconButton"
        android:layout_width="@dimen/min_size_clickable_area"
        android:layout_height="@dimen/min_size_clickable_area"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true"
        android:layout_marginStart="0dp"
        android:layout_marginTop="12dp"
        android:layout_marginEnd="12dp"
        android:layout_marginBottom="12dp"
        android:contentDescription="@string/take_photo_toggle_torch"
        android:insetLeft="4dp"
        android:insetTop="4dp"
        android:insetRight="4dp"
        android:insetBottom="4dp"
        android:tint="@color/white"
        app:backgroundTint="@color/camera_bg_tint"
        app:cornerRadius="@dimen/button_corner_radius"
        app:elevation="0dp"
        app:icon="@drawable/ic_baseline_flash_on_24"
        app:iconGravity="textStart"
        app:iconPadding="0dp"
        app:iconSize="24dp"
        app:iconTint="@color/white"
        app:layout_constraintBottom_toBottomOf="@id/takePhoto"
        app:layout_constraintEnd_toStartOf="@id/takePhoto"
        app:layout_constraintStart_toStartOf="parent" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/switchCamera"
        style="@style/Widget.AppTheme.Button.IconButton"
        android:layout_width="@dimen/min_size_clickable_area"
        android:layout_height="@dimen/min_size_clickable_area"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true"
        android:layout_marginStart="12dp"
        android:layout_marginTop="12dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="12dp"
        android:contentDescription="@string/take_photo_switch_camera"
        android:insetLeft="4dp"
        android:insetTop="4dp"
        android:insetRight="4dp"
        android:insetBottom="4dp"
        android:padding="0dp"
        android:tint="@android:color/white"
        app:backgroundTint="@color/camera_bg_tint"
        app:cornerRadius="@dimen/button_corner_radius"
        app:elevation="0dp"
        app:icon="@drawable/ic_baseline_flip_camera_android_24"
        app:iconGravity="textStart"
        app:iconPadding="0dp"
        app:iconSize="24dp"
        app:iconTint="@color/white"
        app:layout_constraintBottom_toBottomOf="@id/takePhoto"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/takePhoto" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/retake"
        style="@style/Widget.AppTheme.Button.IconButton"
        android:layout_width="@dimen/min_size_clickable_area"
        android:layout_height="@dimen/min_size_clickable_area"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true"
        android:layout_marginBottom="12dp"
        android:contentDescription="@string/take_photo_retake_photo"
        android:insetLeft="0dp"
        android:insetTop="0dp"
        android:insetRight="0dp"
        android:insetBottom="0dp"
        android:padding="0dp"
        android:tint="@android:color/white"
        android:visibility="gone"
        app:backgroundTint="@color/camera_bg_tint"
        app:cornerRadius="@dimen/button_corner_radius"
        app:elevation="0dp"
        app:icon="@drawable/ic_refresh"
        app:iconGravity="textStart"
        app:iconPadding="0dp"
        app:iconSize="24dp"
        app:iconTint="@color/white"
        app:layout_constraintBottom_toBottomOf="@id/takePhoto"
        app:layout_constraintEnd_toStartOf="@id/takePhoto"
        app:layout_constraintStart_toStartOf="parent" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/takePhoto"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="@dimen/standard_double_margin"
        android:contentDescription="@string/take_photo"
        android:tint="@android:color/white"
        app:backgroundTint="@color/colorPrimary"
        app:fabCustomSize="72dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:srcCompat="@drawable/ic_baseline_photo_camera_24" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/send"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true"
        android:contentDescription="@string/take_photo_switch_camera"
        android:paddingStart="24dp"
        android:paddingTop="16dp"
        android:paddingEnd="24dp"
        android:paddingBottom="16dp"
        android:text="@string/take_photo_send"
        android:textAllCaps="false"
        android:textColor="@color/white"
        android:textSize="16sp"
        android:theme="@style/Button.Primary"
        android:tint="@android:color/white"
        android:visibility="gone"
        tools:visibility="visible"
        app:backgroundTint="@color/colorPrimary"
        app:cornerRadius="48dp"
        app:elevation="0dp"
        app:icon="@drawable/ic_send"
        app:iconGravity="textStart"
        app:iconPadding="8dp"
        app:iconSize="24dp"
        app:iconTint="@color/white"
        app:layout_constraintBottom_toBottomOf="@id/takePhoto"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/takePhoto" />
</androidx.constraintlayout.widget.ConstraintLayout>
