<?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"
    style="?attr/cardStyle"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_marginStart="@dimen/card_horizontal_margin"
    android:layout_marginTop="@dimen/card_vertical_margin"
    android:layout_marginEnd="@dimen/card_horizontal_margin"
    android:layout_marginBottom="@dimen/card_vertical_margin"
    android:minHeight="?android:attr/listPreferredItemHeight"
    app:cardCornerRadius="@dimen/card_corner_radius"
    app:cardElevation="@dimen/card_elevation">

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


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

            <ImageView
                android:id="@+id/app_icon"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_marginStart="8dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="8dp"
                android:layout_marginBottom="8dp"
                android:gravity="end"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toStartOf="@+id/app_name"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />


            <TextView
                android:id="@+id/app_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:maxLines="1"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textIsSelectable="false"
                app:layout_constraintBottom_toTopOf="@+id/package_name"
                app:layout_constraintEnd_toStartOf="@+id/master_switch"
                app:layout_constraintStart_toEndOf="@+id/app_icon"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/package_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:maxLines="1"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@android:color/tertiary_text_dark"
                android:textIsSelectable="false"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toStartOf="@id/arrow"
                app:layout_constraintStart_toStartOf="@id/app_name"
                app:layout_constraintTop_toBottomOf="@id/app_name" />

            <ImageView
                android:id="@+id/arrow"
                android:layout_width="20dp"
                android:layout_height="20dp"
                android:layout_marginStart="5dp"
                android:tint="?attr/imageColorTint"
                app:layout_constraintBottom_toBottomOf="@+id/package_name"
                app:layout_constraintEnd_toEndOf="@+id/app_name"
                app:layout_constraintStart_toEndOf="@+id/package_name"
                app:layout_constraintTop_toTopOf="@+id/package_name"
                app:srcCompat="@drawable/ic_arrow" />

            <View
                android:id="@+id/trigger"
                android:layout_width="35dp"
                android:layout_height="0dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="@+id/arrow"
                app:layout_constraintStart_toStartOf="@+id/arrow"
                app:layout_constraintTop_toTopOf="parent" />

            <androidx.appcompat.widget.SwitchCompat
                android:id="@+id/master_switch"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginStart="8dp"
                android:layout_marginEnd="8dp"
                android:checked="false"
                android:gravity="center_vertical"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="@id/app_name"
                app:layout_constraintTop_toTopOf="parent" />


        </androidx.constraintlayout.widget.ConstraintLayout>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/expand_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="5dp"
            android:paddingBottom="5dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/package_name">

            <ImageView
                android:id="@+id/bell"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginStart="16dp"
                android:tint="@color/icon_grey"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toStartOf="@+id/notification_switch"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:srcCompat="@drawable/ic_notifications" />

            <androidx.appcompat.widget.SwitchCompat
                android:id="@+id/notification_switch"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:checked="false"
                android:gravity="center_vertical"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toStartOf="@+id/guideline"
                app:layout_constraintStart_toEndOf="@+id/bell"
                app:layout_constraintTop_toTopOf="parent" />

            <androidx.constraintlayout.widget.Guideline
                android:id="@+id/guideline"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                app:layout_constraintGuide_percent="0.4" />

            <ImageView
                android:id="@+id/bug"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:tint="@color/icon_grey"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toStartOf="@+id/logging_switch"
                app:layout_constraintStart_toStartOf="@+id/guideline"
                app:layout_constraintTop_toTopOf="parent"
                app:srcCompat="@drawable/ic_bug_report" />

            <androidx.appcompat.widget.SwitchCompat
                android:id="@+id/logging_switch"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginEnd="16dp"
                android:checked="false"
                android:gravity="center_vertical"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toStartOf="@+id/guideline2"
                app:layout_constraintStart_toEndOf="@+id/bug"
                app:layout_constraintTop_toTopOf="parent" />

            <androidx.constraintlayout.widget.Guideline
                android:id="@+id/guideline2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                app:layout_constraintGuide_percent="0.8" />

            <ImageView
                android:id="@+id/more_info"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_weight="1"
                android:background="?android:attr/selectableItemBackground"
                android:tint="@color/icon_grey"
                android:visibility="gone"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toStartOf="@+id/delete"
                app:layout_constraintStart_toStartOf="@id/guideline2"
                app:layout_constraintTop_toTopOf="parent"
                app:srcCompat="@drawable/ic_more" />

            <ImageView
                android:id="@+id/delete"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_weight="1"
                android:background="?android:attr/selectableItemBackground"
                android:tint="@color/icon_grey"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="@id/more_info"
                app:layout_constraintTop_toTopOf="parent"
                app:srcCompat="@drawable/ic_delete" />

        </androidx.constraintlayout.widget.ConstraintLayout>
    </LinearLayout>


</androidx.cardview.widget.CardView>


