<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    tools:parentTag="android.widget.RelativeLayout"
    tools:background="@color/offset_background">

    <LinearLayout
        android:id="@+id/bottom_navigation_background"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignTop="@id/item_wrapper"
        android:layoutDirection="ltr">
        <View
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_parent"
            android:background="?barColor" />
        <LinearLayout
            android:id="@+id/cutout_wrapper"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">
            <ImageView
                android:id="@+id/cutout_background"
                android:layout_width="wrap_content"
                android:layout_height="62dp"
                android:src="@drawable/bottom_navigation_inset"
                android:layout_gravity="top"/>
            <View
                android:id="@+id/cutout_fill"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="?barColor" />
        </LinearLayout>
        <View
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_parent"
            android:background="?barColor" />
    </LinearLayout>
    <LinearLayout
        android:id="@+id/item_wrapper"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="48dp"
        android:layout_alignParentBottom="true">
        <com.habitrpg.android.habitica.ui.views.navigation.BottomNavigationItem
            android:id="@+id/habits_tab"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:title="@string/habits"
            app:iconDrawable="@drawable/icon_habits"
            app:selectedIconDrawable="@drawable/icon_habits_selected"
            android:foreground="?selectableItemBackground"
            android:paddingTop="@dimen/spacing_small"
            android:paddingBottom="@dimen/spacing_small"/>
        <com.habitrpg.android.habitica.ui.views.navigation.BottomNavigationItem
            android:layout_width="0dp"
            android:id="@+id/dailies_tab"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:title="@string/dailies"
            app:iconDrawable="@drawable/icon_dailies"
            app:selectedIconDrawable="@drawable/icon_dailies_selected"
            android:foreground="?selectableItemBackground"
            android:paddingTop="@dimen/spacing_small"
            android:paddingBottom="@dimen/spacing_small"/>
        <Space
            android:id="@+id/cutout_space"
            android:layout_width="50dp"
            android:layout_height="wrap_content" />
        <com.habitrpg.android.habitica.ui.views.navigation.BottomNavigationItem
            android:id="@+id/todos_tab"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:title="@string/todos"
            app:iconDrawable="@drawable/icon_todos"
            app:selectedIconDrawable="@drawable/icon_todos_selected"
            android:foreground="?selectableItemBackground"
            android:paddingTop="@dimen/spacing_small"
            android:paddingBottom="@dimen/spacing_small"/>
        <com.habitrpg.android.habitica.ui.views.navigation.BottomNavigationItem
            android:id="@+id/rewards_tab"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:title="@string/rewards"
            app:iconDrawable="@drawable/icon_rewards"
            app:selectedIconDrawable="@drawable/icon_rewards_selected"
            android:foreground="?selectableItemBackground"
            android:paddingTop="@dimen/spacing_small"
            android:paddingBottom="@dimen/spacing_small"/>
    </LinearLayout>

    <FrameLayout
        android:id="@+id/add_button_background"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_centerHorizontal="true"
        android:layout_alignTop="@id/bottom_navigation_background"
        android:layout_marginTop="-39dp"
        android:background="@drawable/fab_background">
        <ImageButton
            android:id="@+id/add_button"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:src="@drawable/fab_plus"
            android:background="@color/transparent"
            android:contentDescription="@string/new_task" />
    </FrameLayout>
    <LinearLayout
        android:id="@+id/submenu_wrapper"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/add_button_background"
        android:orientation="vertical"
        android:gravity="center_horizontal"/>
</merge>