<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
	android:orientation="vertical"
	android:gravity="center_horizontal"
	android:animateLayoutChanges="true"
	tools:context=".activities.PermissionRequestActivity">

	<LinearLayout
        android:id="@+id/permission_progress"
        android:layout_width="0dp"
        android:layout_height="match_parent"
		android:orientation="vertical"
		android:gravity="center_horizontal"
		app:layout_constraintStart_toStartOf="parent"
		app:layout_constraintWidth_percent="0.2"/>

	<TextView
		android:id="@+id/permission_title"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_marginTop="16dp"
		android:gravity="center_horizontal|bottom"
		android:textAlignment="center"
		style="@style/Threema.TextAppearance.Title"
		app:layout_constraintTop_toTopOf="parent"
		app:layout_constraintStart_toEndOf="@id/permission_progress"
		app:layout_constraintEnd_toEndOf="parent"/>

	<ScrollView
		android:layout_width="0dp"
		android:layout_height="0dp"
		android:layout_marginTop="16dp"
		android:padding="16dp"
		app:layout_constraintTop_toBottomOf="@id/permission_title"
		app:layout_constraintStart_toEndOf="@id/permission_progress"
		app:layout_constraintBottom_toTopOf="@id/permission_continue"
		app:layout_constraintEnd_toEndOf="parent">

		<LinearLayout
			android:id="@+id/bottom_linear_layout"
			android:layout_width="match_parent"
			android:layout_height="wrap_content"
			android:orientation="vertical">

			<TextView
				android:id="@+id/permission_description"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:gravity="center_horizontal|bottom"
				android:textAlignment="center"
				style="@style/Threema.TextAppearance.BodyLarge" />

			<TextView
				android:id="@+id/permission_settings_explanation"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:layout_marginTop="16dp"
				android:gravity="center_horizontal|bottom"
				android:textAlignment="center"
				style="@style/Threema.TextAppearance.BodyLarge" />
		</LinearLayout>

	</ScrollView>

	<com.google.android.material.button.MaterialButton
		android:id="@+id/permission_continue"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:text="@string/next"
		style="@style/Threema.MaterialButton.Action"
		app:layout_constraintStart_toEndOf="@id/permission_progress"
		app:layout_constraintEnd_toEndOf="parent"
		app:layout_constraintBottom_toTopOf="@id/ignore_permission" />

	<com.google.android.material.button.MaterialButton
		android:id="@+id/grant_permission_settings"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:text="@string/grant_permission_settings"
		style="@style/Threema.MaterialButton.Action"
		app:layout_constraintStart_toEndOf="@id/permission_progress"
		app:layout_constraintEnd_toEndOf="parent"
		app:layout_constraintBottom_toTopOf="@id/ignore_permission" />

	<com.google.android.material.button.MaterialButton
		android:id="@+id/grant_permission"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/grant_permission"
        style="@style/Threema.MaterialButton.Action"
		app:layout_constraintStart_toEndOf="@id/permission_progress"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toTopOf="@id/ignore_permission" />

	<com.google.android.material.button.MaterialButton
		android:id="@+id/ignore_permission"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:text="@string/ignore_permission"
		style="@style/Threema.MaterialButton.Minimal"
		app:layout_constraintBottom_toTopOf="@id/skip_permission"
		app:layout_constraintStart_toEndOf="@id/permission_progress"
		app:layout_constraintEnd_toEndOf="parent" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/skip_permission"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/use_threema_without_this_permission"
        style="@style/Threema.MaterialButton.Minimal"
        app:layout_constraintBottom_toBottomOf="parent"
	    app:layout_constraintStart_toEndOf="@id/permission_progress"
        app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
