<?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:background="@android:color/black"
       tools:layout_height="@dimen/browser_toolbar_height"
       tools:layout_width="match_parent"
       tools:parentTag="LinearLayout">

    <!-- The site security icon is misaligned with the page title so
         we add a bottom margin to align their bottoms.
         Site security icon must have exact position and size as search icon in
         edit layout -->

    <org.mozilla.gecko.widget.themed.ThemedLinearLayout
        android:id="@+id/url_bar_title_bg"
        style="@style/UrlBar.ThemeBackground"
        android:layout_width="0dp"
        android:layout_height="@dimen/browser_toolbar_url_height"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"
        android:background="@drawable/url_bar_title_bg">

        <org.mozilla.gecko.widget.themed.ThemedImageButton
            android:id="@+id/site_security"
            style="@style/UrlBar.SiteIdentity"
            android:layout_gravity="center_vertical"
            android:contentDescription="@string/site_security"
            android:src="@drawable/security_mode_icon"
            tools:src="@drawable/ic_lock"/>

        <!-- We need this on a separate layer to avoid fading out the toolbar background as well
     and we can't use a hardware layer because that causes problems with the snapshot
     for our toolbar animation.-->
        <org.mozilla.gecko.widget.FadedHorizontalScrollView
            android:id="@+id/url_bar_title_scroll_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fillViewport="true"
            android:scrollbars="none"
            android:overScrollMode="never"
            android:layerType="software"
            gecko:fadeWidth="25dp">

            <org.mozilla.gecko.widget.themed.ThemedTextView
                android:id="@+id/url_bar_title"
                style="@style/UrlBar.Title"
                android:layout_width="wrap_content"
                android:layout_gravity="center_vertical"/>

        </org.mozilla.gecko.widget.FadedHorizontalScrollView>

    </org.mozilla.gecko.widget.themed.ThemedLinearLayout>

    <org.mozilla.gecko.toolbar.PageActionLayout
        android:id="@+id/page_action_layout"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:visibility="gone"
        tools:visibility="visible"/>

    <org.mozilla.gecko.toolbar.ToolbarRoundButton
        android:id="@+id/stop"
        style="@style/UrlBar.ImageButton"
        android:background="@drawable/url_bar_action_button"
        android:contentDescription="@string/stop"
        android:src="@drawable/ic_cancel"
        android:visibility="gone"
        tools:visibility="visible"
        gecko:showLWTBackground="true"/>

</merge>
