<?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="wrap_content">

    <ImageView
        android:id="@+id/doneCheck"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/spacer_1qx"
        android:layout_marginEnd="0dp"
        android:layout_marginBottom="@dimen/spacer_1hx"
        android:contentDescription="@null"
        android:padding="@dimen/spacer_11qx"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/ic_check_white_24dp"
        app:tint="?attr/colorOnSurface"
        tools:visibility="gone" />

    <TextView
        android:id="@+id/doneDate"
        style="?attr/textAppearanceBody1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="@id/doneCheck"
        app:layout_constraintEnd_toStartOf="@id/clearDone"
        app:layout_constraintStart_toEndOf="@id/doneCheck"
        app:layout_constraintTop_toTopOf="@id/doneCheck"
        tools:text="@tools:sample/date/ddmmyy"
        tools:visibility="gone" />

    <TextView
        android:id="@+id/done_due_date"
        style="?attr/textAppearanceBody1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacer_1x"
        app:layout_constraintEnd_toStartOf="@id/clearDone"
        app:layout_constraintStart_toEndOf="@id/doneCheck"
        app:layout_constraintTop_toBottomOf="@id/doneDate"
        tools:text="@tools:sample/date/ddmmyy"
        tools:visibility="gone" />

    <ImageView
        android:id="@+id/clearDone"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginVertical="@dimen/spacer_1hx"
        android:layout_marginStart="@dimen/spacer_1x"
        android:layout_marginEnd="0dp"
        android:contentDescription="@string/label_clear_done"
        android:padding="@dimen/spacer_11qx"
        app:layout_constraintBottom_toBottomOf="@id/doneDate"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@id/doneDate"
        app:srcCompat="@drawable/ic_close_circle"
        tools:visibility="gone" />

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/dueDateDateWrapper"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/spacer_2x"
        android:hint="@string/hint_due_date_date"
        android:labelFor="@id/dueDateDate"
        app:layout_constraintBottom_toTopOf="@id/markAsDone"
        app:layout_constraintEnd_toStartOf="@id/dueDateTimeWrapper"
        app:layout_constraintHorizontal_weight="2"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/done_due_date"
        app:startIconDrawable="@drawable/calendar_blank_24dp">

        <EditText
            android:id="@+id/dueDateDate"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:enabled="true"
            android:focusable="false"
            android:importantForAutofill="no"
            android:inputType="date"
            android:maxLines="1"
            tools:text="01/07/2020" />
    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/dueDateTimeWrapper"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/spacer_1hx"
        android:hint="@string/hint_due_date_time"
        android:labelFor="@id/dueDateTime"
        app:layout_constraintBottom_toBottomOf="@id/dueDateDateWrapper"
        app:layout_constraintEnd_toStartOf="@id/clearDueDate"
        app:layout_constraintHorizontal_weight="1"
        app:layout_constraintStart_toEndOf="@id/dueDateDateWrapper"
        app:layout_constraintTop_toTopOf="@id/dueDateDateWrapper">

        <EditText
            android:id="@+id/dueDateTime"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:enabled="true"
            android:focusable="false"
            android:importantForAutofill="no"
            android:inputType="datetime"
            android:maxLines="1"
            android:minLines="0"
            android:textAlignment="center"
            tools:text="11:45" />
    </com.google.android.material.textfield.TextInputLayout>

    <ImageView
        android:id="@+id/clearDueDate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginVertical="@dimen/spacer_1hx"
        android:layout_marginStart="@dimen/spacer_1x"
        android:layout_marginEnd="0dp"
        android:contentDescription="@string/label_clear_due_date"
        android:padding="@dimen/spacer_11qx"
        android:translationY="@dimen/spacer_1hx"
        app:layout_constraintBottom_toBottomOf="@id/dueDateTimeWrapper"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/dueDateTimeWrapper"
        app:layout_constraintTop_toTopOf="@id/dueDateTimeWrapper"
        app:srcCompat="@drawable/ic_close_circle" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/markAsDone"
        style="@style/Widget.Material3.Button"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacer_2x"
        android:layout_marginBottom="@dimen/spacer_1hx"
        android:text="@string/mark_as_done"
        app:backgroundTint="@color/defaultBrand"
        app:icon="@drawable/ic_check_white_24dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/dueDateDateWrapper" />
</androidx.constraintlayout.widget.ConstraintLayout>
