<?xml version="1.0" encoding="utf-8"?>

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<merge xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:gecko="http://schemas.android.com/apk/res-auto"
       xmlns:tools="http://schemas.android.com/tools"
       tools:layout_height="@dimen/browser_toolbar_url_height"
       tools:layout_width="match_parent"
       tools:parentTag="RelativeLayout">

    <!-- Note: any layout parameters setting the right edge of
         this View should be matched in the url_bar_translating_edge. -->
    <ImageView
        android:id="@+id/url_bar_entry"
        style="@style/UrlBar.Entry"
        android:layout_marginBottom="8dp"
        android:layout_marginTop="8dp"
        android:clickable="false"
        android:duplicateParentState="true"
        android:focusable="false"
        android:scaleType="fitXY"
        android:src="@android:color/transparent"/>

    <!-- A View that clips with url_bar_entry and translates
         around it to animate growing the url bar,
         which occurs in the display/editing mode transitions. -->
    <ImageView
        android:id="@+id/url_bar_translating_edge"
        style="@style/UrlBar.Edge"
        android:layout_alignBottom="@id/url_bar_entry"
        android:layout_alignTop="@id/url_bar_entry"
        android:clickable="false"
        android:duplicateParentState="true"
        android:focusable="false"
        android:scaleType="fitXY"
        android:src="@android:color/transparent"
        android:visibility="invisible"/>

    <org.mozilla.gecko.toolbar.ToolbarRoundButton
        android:id="@+id/menu"
        style="@style/UrlBar.Menu"
        android:background="@drawable/url_bar_action_button"
        android:contentDescription="@string/menu"
        android:src="@drawable/ic_overflow"
        gecko:showLWTBackground="true"/>

    <org.mozilla.gecko.toolbar.ToolbarRoundButton
        android:id="@+id/tabs"
        style="@style/UrlBar.Tabs"
        android:layout_alignWithParentIfMissing="true"
        android:background="@drawable/url_bar_action_button"
        gecko:showLWTBackground="true"/>

    <org.mozilla.gecko.toolbar.TabCounter
        android:id="@+id/tabs_counter"
        style="@style/UrlBar.TabCounter"
        android:layout_height="24dip"
        android:layout_centerVertical="true"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:gravity="center_horizontal"
        gecko:drawableTintList="@color/url_bar_image_color"/>

    <!-- Note that the edit components are invisible so that the views
         depending on their location can properly layout. -->
    <org.mozilla.gecko.toolbar.ToolbarRoundButton
        android:id="@+id/edit_cancel"
        style="@style/UrlBar.EditCancel"
        android:background="@drawable/url_bar_action_button"
        android:contentDescription="@string/edit_mode_cancel"
        android:src="@drawable/ic_cancel"
        android:visibility="invisible"
        gecko:showLWTBackground="true"/>

    <!-- The space to the left of the cancel button would be larger than the right because
         the url bar drawable contains some whitespace, so we compensate by removing
         some padding from the right (value determined through experimentation). -->
    <org.mozilla.gecko.toolbar.ToolbarEditLayout
        android:id="@+id/edit_layout"
        style="@style/UrlBar.EditLayout"
        android:visibility="invisible"/>

    <org.mozilla.gecko.toolbar.ToolbarDisplayLayout
        android:id="@+id/display_layout"
        style="@style/UrlBar.DisplayLayout"/>

</merge>
