<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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:id="@+id/scrollable"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/fragment_home_background"
    android:fillViewport="true"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/content_home"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingStart="16dp"
        android:paddingTop="30dp"
        android:paddingEnd="16dp"
        android:paddingBottom="16dp"
        android:transitionName="@string/transition_active_transaction_background">

        <!-- Active Transaction - primary -->
        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/header_active_transaction"
            android:layout_width="match_parent"
            android:layout_height="70dp"
            android:background="@drawable/background_rounded_corners_opaque"
            android:clipToPadding="false"
            android:padding="16dp"
            android:transitionName="@string/transition_active_transaction_card"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <com.airbnb.lottie.LottieAnimationView
                android:id="@+id/lottie_active_transaction"
                android:layout_width="36dp"
                android:layout_height="0dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:lottie_autoPlay="true"
                app:lottie_loop="false"
                app:lottie_rawRes="@raw/lottie_active_transaction_fail" />

            <TextView
                android:id="@+id/text_active_transaction_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginLeft="8dp"
                android:text="Preparing  1.01 ZEC"
                android:textSize="@dimen/text_size_body_1"
                android:textStyle="bold"
                android:transitionName="@string/transition_active_transaction_title"
                app:layout_constraintStart_toEndOf="@id/lottie_active_transaction"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/text_active_transaction_subtitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="to zsapling...123456789"
                android:textSize="@dimen/text_size_caption"
                android:transitionName="@string/transition_active_transaction_address"
                app:layout_constraintStart_toStartOf="@id/text_active_transaction_title"
                app:layout_constraintTop_toBottomOf="@id/text_active_transaction_title" />

            <Button
                android:id="@+id/button_active_transaction_cancel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@null"
                android:text="cancel"
                android:textColor="@color/selector_red_button"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <!-- Label: Past Activity -->
        <TextView
            android:id="@+id/text_transaction_header"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:paddingBottom="16dp"
            android:text="Past Activity"
            android:textColor="@color/text_dark"
            android:textSize="@dimen/text_size_body_2"
            android:textStyle="bold"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/header_active_transaction" />

        <!-- Transactions -->
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recycler_transactions"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:clipToPadding="false"

            android:paddingBottom="72dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/text_transaction_header"
            tools:itemCount="15"
            tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            tools:listitem="@layout/item_transaction"
            tools:orientation="vertical" />

        <!-- Empty: image -->
        <ImageView
            android:id="@+id/image_empty_wallet"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.281966"
            app:srcCompat="@drawable/ic_emptywallet" />

        <!-- Empty: message -->
        <TextView
            android:id="@+id/text_wallet_message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:gravity="center"
            android:padding="16dp"
            android:text="@string/home_empty_wallet"
            android:textColor="#AAAAAA"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/image_empty_wallet" />


        <!--        -->
        <!-- Groups -->
        <!--        -->

        <androidx.constraintlayout.widget.Group
            android:id="@+id/group_full_view_items"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:constraint_referenced_ids="text_transaction_header,recycler_transactions" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/group_empty_view_items"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:constraint_referenced_ids="image_empty_wallet,text_wallet_message" />
    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.core.widget.NestedScrollView>