<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
    tools:context="com.keylesspalace.tusky.components.filters.EditFilterActivity">

    <include
        android:id="@+id/includedToolbar"
        layout="@layout/toolbar_basic" />

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:paddingStart="?android:attr/listPreferredItemPaddingStart"
            android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/filter_title_wrapper"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:hint="@string/label_filter_title">
                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/filterTitle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textNoSuggestions"/>
            </com.google.android.material.textfield.TextInputLayout>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="@string/label_filter_keywords"
                style="@style/TextAppearance.Material3.TitleSmall"
                android:textColor="?attr/colorAccent" />

            <com.google.android.material.chip.ChipGroup
                    android:id="@+id/keywordChips"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <com.google.android.material.chip.Chip
                        android:id="@+id/actionChip"
                        style="@style/Widget.MaterialComponents.Chip.Action"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:checkable="false"
                        android:text="@string/action_add"
                        app:chipIcon="@drawable/ic_plus_24dp"
                        app:chipSurfaceColor="@color/tusky_blue" />
            </com.google.android.material.chip.ChipGroup>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="@string/label_filter_action"
                style="@style/TextAppearance.Material3.TitleSmall"
                android:textColor="?attr/colorAccent" />

            <RadioGroup
                android:id="@+id/filter_action_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <RadioButton
                    android:id="@+id/filter_action_warn"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="48dp"
                    android:text="@string/filter_description_warn"/>
                <RadioButton
                    android:id="@+id/filter_action_hide"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="48dp"
                    android:text="@string/filter_description_hide"/>
            </RadioGroup>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="@string/label_duration"
                style="@style/TextAppearance.Material3.TitleSmall"
                android:textColor="?attr/colorAccent" />

            <Spinner
                android:id="@+id/filterDurationSpinner"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="48dp"
                android:entries="@array/filter_duration_names"
                />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="@string/label_filter_context"
                style="@style/TextAppearance.Material3.TitleSmall"
                android:textColor="?attr/colorAccent" />

            <com.google.android.material.switchmaterial.SwitchMaterial
                android:id="@+id/filter_context_home"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="48dp"
                android:text="@string/title_home" />

            <com.google.android.material.switchmaterial.SwitchMaterial
                android:id="@+id/filter_context_notifications"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="48dp"
                android:text="@string/title_notifications" />

            <com.google.android.material.switchmaterial.SwitchMaterial
                android:id="@+id/filter_context_public"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="48dp"
                android:text="@string/pref_title_public_filter_keywords" />

            <com.google.android.material.switchmaterial.SwitchMaterial
                android:id="@+id/filter_context_thread"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="48dp"
                android:text="@string/pref_title_thread_filter_keywords" />

            <com.google.android.material.switchmaterial.SwitchMaterial
                android:id="@+id/filter_context_account"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="48dp"
                android:text="@string/pref_title_account_filter_keywords" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingStart="?android:attr/listPreferredItemPaddingStart"
                android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
                android:gravity="end"
                style="?android:attr/buttonBarStyle">

                <Button
                    android:id="@+id/filter_delete_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/action_delete"
                    style="?android:attr/buttonBarButtonStyle" />

                <Button
                    android:id="@+id/filter_save_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:text="@string/action_save"
                    style="?android:attr/buttonBarButtonStyle" />
            </LinearLayout>

        </LinearLayout>
    </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
