<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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"
    android:foreground="?android:attr/selectableItemBackground"
    app:cardCornerRadius="16dp">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipToPadding="false"
        android:paddingBottom="16dp">

        <TextView
            android:id="@+id/tv_service_name"
            style="@style/TitleLarge"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginTop="16dp"
            android:ellipsize="end"
            android:maxLines="1"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="Service Name" />

        <TextView
            android:id="@+id/tv_service_uuid"
            style="@style/TextSmall"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:ellipsize="end"
            android:maxLines="1"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tv_service_name"
            tools:text="0x1809" />

        <TextView
            android:id="@+id/tv_service_type"
            style="@style/TextSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tv_service_uuid"
            tools:text="Primary Service" />

        <include
            android:id="@+id/sp_service_name"
            layout="@layout/horizontal_separator"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="6dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tv_service_type" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/ib_copy"
            style="@style/Widget.Material3.Button.IconButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:background="@drawable/btn_grey_ripple_effect"
            android:contentDescription="@string/label_copy"
            app:icon="@drawable/redesign_ic_card_view_action_icon_copy"
            app:tint="@color/silabs_primary_icon"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/sp_service_name" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/ib_remove"
            style="@style/Widget.Material3.Button.IconButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/space_XS"
            android:background="@drawable/btn_grey_ripple_effect"
            android:contentDescription="@string/label_remove"
            app:icon="@drawable/redesign_ic_card_view_action_icon_delete"
            app:tint="@color/silabs_primary_icon"
            app:layout_constraintStart_toEndOf="@id/ib_copy"
            app:layout_constraintTop_toBottomOf="@id/sp_service_name" />

        <com.siliconlabs.bledemo.common.views.ExpandArrow
            android:id="@+id/expand_arrow"
            style="@style/Widget.Material3.Button.IconButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="16dp"
            android:contentDescription="@string/content_desc_dropdown_arrow"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/sp_service_name" />

        <include
            android:id="@+id/sp_service_icons_collapsed"
            layout="@layout/horizontal_separator"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_marginHorizontal="16dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/expand_arrow" />


        <LinearLayout
            android:id="@+id/ll_characteristics_outer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="16dp"
            android:clickable="true"
            android:focusable="true"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/expand_arrow"
            android:orientation="vertical"
            tools:visibility="visible"
            android:visibility="gone">

            <include
                android:id="@+id/sp_service_icons_expanded"
                layout="@layout/horizontal_separator"
                android:layout_width="match_parent"
                android:layout_height="1dp" />

            <LinearLayout
                android:id="@+id/ll_characteristics"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
            </LinearLayout>
        </LinearLayout>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/btn_add_characteristic"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:text="@string/button_add_characteristic"
            style="@style/button_add_data"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/ll_characteristics_outer" />
    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.cardview.widget.CardView>