<?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"
    android:orientation="vertical"
    tools:showIn="@layout/activity_push_notification">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true">

        <com.google.android.material.appbar.MaterialToolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:navigationIcon="@drawable/ic_arrow_back_24dp"
            app:title="@string/app_name" />
    </com.google.android.material.appbar.AppBarLayout>

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

            <LinearLayout
                android:id="@+id/progressWrapper"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center"
                android:orientation="vertical"
                android:padding="@dimen/spacer_2x">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="@dimen/spacer_2x"
                    android:text="@string/updating_card"
                    android:textAppearance="?attr/textAppearanceBody1" />

                <ProgressBar
                    android:id="@+id/progress"
                    style="?android:attr/progressBarStyleHorizontal"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:indeterminate="true"
                    android:indeterminateTint="@color/defaultBrand" />
            </LinearLayout>

            <androidx.core.widget.NestedScrollView
                android:id="@+id/browserFallback"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:padding="@dimen/spacer_2x"
                android:visibility="gone">

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

                    <TextView
                        android:id="@+id/subject"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        tools:maxLength="200"
                        tools:text="@tools:sample/lorem/random" />

                    <TextView
                        android:id="@+id/message"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/spacer_2x"
                        android:visibility="gone"
                        tools:maxLength="200"
                        tools:text="@tools:sample/lorem/random"
                        tools:visibility="visible" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/submit"
                        style="@style/Widget.Material3.Button"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/spacer_2x"
                        android:text="@string/open_in_browser" />
                </LinearLayout>
            </androidx.core.widget.NestedScrollView>

            <androidx.core.widget.NestedScrollView
                android:id="@+id/errorWrapper"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:padding="@dimen/spacer_2x"
                android:visibility="gone">

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

                    <TextView
                        android:id="@+id/errorExplanation"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:autoLink="web"
                        tools:text="@string/push_notification_link_empty" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/showError"
                        style="@style/Widget.Material3.Button"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/spacer_2x"
                        android:text="@string/show_error" />
                </LinearLayout>
            </androidx.core.widget.NestedScrollView>
        </LinearLayout>
    </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>