<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="@dimen/padding"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/title_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/margin_big"
        android:fontFamily="sans-serif"
        android:text="@string/pin_view"
        android:textSize="@dimen/headline_text"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/pinTextField"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/margin_big"
        android:hint="@string/hint_pin"
        app:counterEnabled="true"
        app:counterMaxLength="12"
        app:counterOverflowTextAppearance="@style/helper"
        app:counterTextAppearance="@style/helper"
        app:endIconMode="password_toggle"
        app:helperText="@string/pin_helper_text"
        app:helperTextEnabled="true"
        app:helperTextTextAppearance="@style/helper"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/title_text">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fontFamily="sans-serif"
            android:inputType="numberPassword"
            android:singleLine="true"
            android:textSize="@dimen/regular_text" />

    </com.google.android.material.textfield.TextInputLayout>

    <TextView
        android:id="@+id/save_pin_question"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/margin_big"
        android:paddingTop="@dimen/padding"
        android:fontFamily="sans-serif"
        android:text="@string/save_pin"
        android:textSize="@dimen/regular_text"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/pinTextField" />

    <LinearLayout
        android:id="@+id/save_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/save_pin_question">

        <com.google.android.material.switchmaterial.SwitchMaterial
            android:id="@+id/save_switch"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/margin_big"
            android:checked="true"
            android:minWidth="48dp"
            android:minHeight="48dp"
            android:layout_gravity="center_vertical"/>

        <TextView
            android:id="@+id/save_status"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/margin_big"
            android:fontFamily="sans-serif"
            android:text="@string/pin_save_on"
            android:textSize="@dimen/regular_text"
            android:layout_gravity="center_vertical"/>

    </LinearLayout>

    <Button
        android:id="@+id/button_continue"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/margin_big"
        android:fontFamily="sans-serif"
        android:text="@string/continue_button"
        android:textSize="@dimen/regular_text"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/save_layout" />

    <Button
        android:id="@+id/button_cancel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/margin_big"
        android:fontFamily="sans-serif"
        android:text="@string/cancel_text"
        android:textSize="@dimen/regular_text"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/button_continue" />

</androidx.constraintlayout.widget.ConstraintLayout>