<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/brand_window_bg"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        android:paddingStart="12dp"
        android:paddingEnd="12dp"
        android:paddingTop="12dp">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/btnBack"
            android:layout_width="@dimen/nav_btn_size"
            android:layout_height="@dimen/nav_btn_size"
            android:text=""
            android:textAllCaps="false"
            app:icon="@drawable/ic_chevron_left"
            app:iconTint="@color/btn_nav_left_icon_tint"
            app:iconSize="@dimen/nav_icon_size"
            app:iconPadding="0dp"
            app:cornerRadius="999dp"
            app:backgroundTint="@color/btn_nav_left_tint"
            app:rippleColor="@color/btn_nav_left_ripple" />

        <View
            android:layout_width="0dp"
            android:layout_height="1dp"
            android:layout_weight="1" />

        <Spinner
            android:id="@+id/langSpinner"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/language_picker_height"
            android:background="@drawable/bg_control_chip_dropdown"
            android:minWidth="@dimen/language_picker_min_width"
            android:popupBackground="@drawable/bg_spinner_popup" />

    </LinearLayout>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <androidx.core.widget.NestedScrollView
            android:id="@+id/scrollContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fillViewport="true"
            android:clipToPadding="false"
            android:paddingBottom="16dp">

            <LinearLayout
                android:id="@+id/questionContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingStart="12dp"
                android:paddingEnd="12dp"
                android:paddingTop="8dp" />
        </androidx.core.widget.NestedScrollView>

        <include
            android:id="@+id/questionnaireSaveLoading"
            layout="@layout/view_screen_loading_overlay"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </FrameLayout>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="12dp"
        android:background="@color/brand_surface"
        android:elevation="8dp">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/btnSave"
            android:layout_width="match_parent"
            android:layout_height="@dimen/nav_btn_size"
            android:textAllCaps="false"
            android:minWidth="0dp"
            android:insetLeft="0dp"
            android:insetRight="0dp"
            app:cornerRadius="999dp"
            app:backgroundTint="@color/btn_nav_right_tint"
            app:rippleColor="@color/btn_nav_right_ripple" />

        <ProgressBar
            android:id="@+id/progressBar"
            style="?android:attr/progressBarStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:visibility="gone" />
    </FrameLayout>

</LinearLayout>
