<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    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="#FFFFFF">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay"
            app:titleTextAppearance="@style/ToolbarTitle"/>

    </android.support.design.widget.AppBarLayout>

    <LinearLayout
        android:id="@+id/bottom_panel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true"
        android:gravity="end"
        android:orientation="horizontal"
        android:paddingEnd="10dp"
        android:paddingStart="10dp">

        <org.odk.collect.android.views.DynamicWidthSpinner
            android:id="@+id/paint_style_spinner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:visibility="gone"/>

        <Spinner
            android:id="@+id/size_spinner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"/>

        <org.odk.collect.android.views.DynamicWidthSpinner
            android:id="@+id/mode_spinner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="10dp"
            android:layout_marginStart="10dp"/>

        <ImageView
            android:id="@+id/color"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_gravity="center_vertical"
            android:background="#000000"
            android:padding="2dp"/>

    </LinearLayout>

    <org.odk.collect.android.views.drawing.DrawView
        android:id="@+id/draw_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/bottom_panel"
        android:layout_below="@id/app_bar"
        android:transitionName="image"
        app:dv_draw_alpha="255"
        app:dv_draw_anti_alias="true"
        app:dv_draw_corners="round"
        app:dv_draw_dither="true"
        app:dv_draw_enable_zoom="true"
        app:dv_draw_max_zoom_factor="8"
        app:dv_draw_zoomregion_maxscale="5"
        app:dv_draw_zoomregion_minscale="2"
        app:dv_draw_zoomregion_scale="4"/>

</RelativeLayout>