<?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">

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_scrollFlags="scroll|enterAlwaysCollapsed">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/background">

                <ImageView
                    android:id="@+id/imageView"
                    style="@style/SudHeaderIcon"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:srcCompat="@drawable/ic_cloud_download"
                    app:tint="?android:colorAccent"
                    tools:ignore="ContentDescription" />

                <TextView
                    android:id="@+id/titleView"
                    style="@style/SudHeaderTitle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/restore_select_packages"
                    android:textColor="?android:textColorSecondary"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/imageView" />

                <TextView
                    android:id="@+id/backupNameView"
                    style="@style/SudDescription"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:textColor="?android:textColorTertiary"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintHorizontal_bias="0.0"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/titleView"
                    tools:text="Pixel 2 XL - Owner of the device" />

                <TextView
                    android:id="@+id/toggleAllTextView"
                    android:layout_width="0dp"
                    android:layout_height="48dp"
                    android:layout_marginTop="16dp"
                    android:layout_marginEnd="0dp"
                    android:background="?selectableItemBackground"
                    android:clickable="true"
                    android:gravity="center_vertical"
                    android:paddingStart="40dp"
                    android:text="@string/restore_select_packages_all"
                    android:textSize="16sp"
                    app:layout_constraintEnd_toStartOf="@+id/toggleAllView"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/backupNameView"
                    tools:ignore="RtlSymmetry" />

                <com.google.android.material.checkbox.MaterialCheckBox
                    android:id="@+id/toggleAllView"
                    style="@style/SudContent"
                    android:layout_width="0dp"
                    android:layout_height="48dp"
                    android:layout_marginTop="16dp"
                    android:clickable="false"
                    android:focusable="false"
                    android:gravity="center_vertical"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/backupNameView"
                    tools:checked="true" />

                <com.google.android.material.divider.MaterialDivider
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="40dp"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="8dp"
                    app:dividerColor="?attr/colorControlNormal"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/toggleAllView" />

            </androidx.constraintlayout.widget.ConstraintLayout>

        </com.google.android.material.appbar.CollapsingToolbarLayout>

    </com.google.android.material.appbar.AppBarLayout>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/appList"
        style="@style/SudContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginStart="0dp"
        android:layout_marginTop="0dp"
        android:layout_marginEnd="0dp"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:listitem="@layout/list_item_app_status" />

    <Button
        android:id="@+id/button"
        style="@style/SudPrimaryButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_marginEnd="16dp"
        android:text="@string/restore_backup_button"
        app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
