<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginTop="2dp"
    android:layout_marginBottom="2dp"
    android:gravity="center_vertical"
    android:orientation="vertical"
    tools:ignore="RtlHardcoded,RtlSymmetry">

    <com.google.android.material.card.MaterialCardView
        android:id="@+id/card_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="?attr/materialCardViewElevatedStyle">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                app:layout_constraintTop_toTopOf="parent"
                android:id="@+id/main_card_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:padding="6dp">

                <!-- Module components -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical">

                    <com.google.android.material.chip.Chip
                        android:id="@+id/invalid_module_props"
                        android:layout_width="wrap_content"
                        android:layout_height="40dp"
                        android:text="@string/low_quality_module"
                        android:textSize="12sp"
                        android:layout_marginEnd="4dp"
                        android:visibility="gone"
                        app:chipStartPadding="4dp"
                        app:chipEndPadding="2dp"
                        app:chipIconSize="15dp"
                        app:chipIcon="@drawable/ic_baseline_error_24" />

                    <TextView
                        android:id="@+id/title_text"
                        android:paddingStart="2dp"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:maxLines="1"
                        android:text="@string/loading"
                        android:textSize="16sp"
                        android:textAppearance="?attr/textAppearanceTitleMedium"
                        />

                    <com.google.android.material.switchmaterial.SwitchMaterial
                        android:id="@+id/switch_action"
                        android:layout_width="wrap_content"
                        android:layout_height="35dp" />

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/button_action"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="8dp"
                        android:background="@android:color/transparent"
                        android:importantForAccessibility="no"
                        android:src="@drawable/ic_baseline_delete_forever_24"
                        android:textSize="16sp"
                        tools:ignore="RtlHardcoded" />

                </LinearLayout>

                <TextView
                    android:id="@+id/credit_text"
                    android:paddingStart="2dp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/loading"
                    android:textSize="12sp"
                    android:textAppearance="?attr/textAppearanceBodyMedium"
                    android:textColor="?android:attr/textColorSecondary"
                    />
                <TextView
                    android:id="@+id/description_text"
                    android:paddingStart="2dp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:text="@string/loading"
                    android:textSize="16sp"
                    android:textAppearance="?attr/textAppearanceBodyMedium"
                    android:textColor="?android:attr/textColorSecondary"
                    />

                <TextView
                    android:id="@+id/updated_text"
                    android:paddingStart="2dp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginTop="8dp"
                    android:text="@string/loading"
                    android:textSize="12sp" />

            </LinearLayout>

            <TextView
                app:layout_constraintTop_toBottomOf="@id/main_card_text"
                android:visibility="gone"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/module_layout_helper"
                android:orientation="vertical">

            </TextView>
            <!-- Buttons -->
            <HorizontalScrollView
                app:layout_constraintBottom_toBottomOf="@id/module_layout_helper"
                android:visibility="gone"
                android:id="@+id/module_options_holder"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:scrollbars="none">

                <com.google.android.material.chip.ChipGroup
                    android:animateLayoutChanges="true"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="end"
                    android:paddingRight="4dp"
                    android:paddingLeft="4dp"
                    app:singleLine="true">

                    <com.google.android.material.chip.Chip
                        android:id="@+id/button_action1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/loading"
                        android:visibility="gone"
                        app:chipIcon="@drawable/ic_baseline_error_24" />

                    <com.google.android.material.chip.Chip
                        android:id="@+id/button_action2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/loading"
                        android:visibility="gone"
                        app:chipIcon="@drawable/ic_baseline_error_24" />


                    <com.google.android.material.chip.Chip
                        android:id="@+id/button_action3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/loading"
                        android:visibility="gone"
                        app:chipIcon="@drawable/ic_baseline_error_24" />

                    <com.google.android.material.chip.Chip
                        android:id="@+id/button_action4"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/loading"
                        android:visibility="gone"
                        app:chipIcon="@drawable/ic_baseline_error_24" />

                    <com.google.android.material.chip.Chip
                        android:id="@+id/button_action5"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/loading"
                        android:visibility="gone"
                        app:chipIcon="@drawable/ic_baseline_error_24" />

                    <com.google.android.material.chip.Chip
                        android:id="@+id/button_action6"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/loading"
                        android:visibility="gone"
                        app:chipIcon="@drawable/ic_baseline_error_24" />
                </com.google.android.material.chip.ChipGroup>
            </HorizontalScrollView>
        </androidx.constraintlayout.widget.ConstraintLayout>

    </com.google.android.material.card.MaterialCardView>
</LinearLayout>
