<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:paddingTop="@dimen/spacing_different_topic"
    android:paddingStart="@dimen/spacing_different_topic"
    android:paddingEnd="@dimen/spacing_different_topic"
    android:paddingBottom="@dimen/spacing_same_topic">

    <TextView
            android:id="@+id/tvTitle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/title_filter_options"
            android:textAppearance="@style/TextAppearance.Bitsy.Headline5"
            app:layout_constraintTop_toTopOf="parent"/>

    <TextView
        android:id="@+id/tvTransactionDirection"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_different_topic"
        android:text="@string/title_transactions"
        android:textSize="16sp"
        app:layout_constraintTop_toBottomOf="@id/tvTitle"/>

    <RadioGroup
        android:id="@+id/rgTransactionDirection"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:orientation="horizontal"
        app:layout_constraintTop_toBottomOf="@id/tvTransactionDirection">

        <RadioButton
            android:id="@+id/rbTransactionAll"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/text__all"/>

        <RadioButton
            android:id="@+id/rbTransactionSent"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/text__sent"/>

        <RadioButton
            android:id="@+id/rbTransactionReceived"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/text__received"/>

    </RadioGroup>

    <!-- Date Range -->

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="2dp"
        android:text="@string/text__date_range"
        android:textSize="16sp"
        app:layout_constraintTop_toTopOf="@id/cbDateRange"
        app:layout_constraintBottom_toBottomOf="@id/cbDateRange"
        app:layout_constraintStart_toStartOf="parent"/>

    <CheckBox
        android:id="@+id/cbDateRange"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_different_topic"
        android:text="@string/text__all"
        app:layout_constraintTop_toBottomOf="@id/rgTransactionDirection"
        app:layout_constraintEnd_toEndOf="parent"/>

    <LinearLayout
        android:id="@+id/llDateRange"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="4dp"
        android:orientation="horizontal"
        app:layout_constraintTop_toBottomOf="@id/cbDateRange"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent">

        <TextView
            android:id="@+id/tvStartDate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            tools:text="12/08/2017"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="12dp"
            android:layout_marginEnd="12dp"
            android:text="@string/text__to"/>

        <TextView
            android:id="@+id/tvEndDate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            tools:text="12/09/2017"/>

    </LinearLayout>

    <!-- Asset -->

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="2dp"
        android:text="@string/text__asset"
        android:textSize="16sp"
        app:layout_constraintTop_toTopOf="@id/cbAsset"
        app:layout_constraintBottom_toBottomOf="@id/cbAsset"
        app:layout_constraintStart_toStartOf="parent"/>

    <CheckBox
        android:id="@+id/cbAsset"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_different_topic"
        android:text="@string/text__all"
        app:layout_constraintTop_toBottomOf="@+id/llDateRange"
        app:layout_constraintEnd_toEndOf="parent"/>

    <Spinner
        android:id="@+id/sAsset"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        tools:listitem="@android:layout/simple_list_item_1"
        app:layout_constraintTop_toBottomOf="@id/cbAsset"/>

    <!-- Ignore Agorise Fees -->

    <com.google.android.material.switchmaterial.SwitchMaterial
        android:id="@+id/switchAgoriseFees"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_same_topic"
        android:switchPadding="12dp"
        android:text="@string/text__ignore_network_fees"
        android:textSize="16sp"
        android:textColor="?android:textColorSecondary"
        app:layout_constraintTop_toBottomOf="@id/sAsset"/>

    <!-- Equivalent Value -->

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="2dp"
        android:text="@string/text__equivalent_value"
        android:textSize="16sp"
        app:layout_constraintTop_toTopOf="@id/cbEquivalentValue"
        app:layout_constraintBottom_toBottomOf="@id/cbEquivalentValue"
        app:layout_constraintStart_toStartOf="parent"/>

    <CheckBox
        android:id="@+id/cbEquivalentValue"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_different_topic"
        android:text="@string/text__all"
        app:layout_constraintTop_toBottomOf="@id/switchAgoriseFees"
        app:layout_constraintEnd_toEndOf="parent"/>

    <LinearLayout
        android:id="@+id/llEquivalentValue"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="4dp"
        android:orientation="horizontal"
        app:layout_constraintTop_toBottomOf="@id/cbEquivalentValue">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/text__between"/>

        <EditText
            android:id="@+id/etFromEquivalentValue"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:inputType="number"
            android:digits="0123456789"
            android:singleLine="true"
            android:imeOptions="actionNext"
            android:textAlignment="center"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/text__and"/>

        <EditText
            android:id="@+id/etToEquivalentValue"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:inputType="number"
            android:digits="0123456789"
            android:singleLine="true"
            android:imeOptions="actionDone"
            android:textAlignment="center"/>

        <TextView
                android:id="@+id/tvEquivalentValueSymbol"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                tools:text="USD"/>

    </LinearLayout>

    <com.google.android.material.button.MaterialButton
            android:id="@+id/btnFilter"
            style="@style/Widget.Bitsy.Button.TextButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/spacing_same_topic"
            android:text="@string/button__filter"
            app:layout_constraintTop_toBottomOf="@id/llEquivalentValue"
            app:layout_constraintEnd_toEndOf="parent"
            android:textColor="@color/colorPrimary"/>

    <com.google.android.material.button.MaterialButton
            android:id="@+id/btnCancel"
            style="@style/Widget.Bitsy.Button.TextButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@android:string/cancel"
            app:layout_constraintTop_toTopOf="@id/btnFilter"
            app:layout_constraintEnd_toStartOf="@id/btnFilter"
            android:textColor="@color/colorPrimary"/>

</androidx.constraintlayout.widget.ConstraintLayout>
