<?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"
    app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <com.google.android.material.bottomsheet.BottomSheetDragHandleView
        android:id="@+id/drag_handle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/text_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="@string/groups"
        android:textSize="20sp"
        app:layout_constraintTop_toBottomOf="@+id/drag_handle"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <TextView
        android:id="@+id/addGroupInfo"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="8dp"
        android:padding="8dp"
        android:text="@string/no_group_selection"
        app:layout_constraintTop_toBottomOf="@+id/text_title"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        android:visibility="gone"/>

    <LinearLayout
        android:id="@+id/addGroup"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="8dp"
        android:layout_marginTop="15dp"
        android:background="?android:attr/selectableItemBackground"
        android:gravity="center"
        android:orientation="horizontal"
        android:padding="8dp"
        app:layout_constraintTop_toBottomOf="@+id/addGroupInfo"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        android:visibility="gone">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/new_group"
            android:src="@drawable/ic_outline_add_24" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="10dp"
            android:text="@string/new_group"
            android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
    </LinearLayout>

    <androidx.core.widget.NestedScrollView
        android:id="@+id/scrollView"
        android:layout_marginTop="15dp"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:minWidth="150dp"
        app:layout_constraintHeight_default="wrap"
        app:layout_constraintTop_toBottomOf="@+id/addGroup"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="150dp"
            android:orientation="vertical">

            <com.google.android.material.chip.ChipGroup
                android:id="@+id/groupChipGroup"
                android:paddingStart="8dp"
                android:paddingEnd="8dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
            </com.google.android.material.chip.ChipGroup>
        </LinearLayout>

    </androidx.core.widget.NestedScrollView>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/scrollView"
        app:layout_constraintEnd_toEndOf="parent"
        android:orientation="horizontal">
        <Button
            android:id="@+id/btnSave"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/save"
            style="@style/Widget.Material3.Button.TextButton" />

        <Button
            android:id="@+id/btnClear"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/clear"
            style="@style/Widget.Material3.Button.TextButton" />
    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
