mobile/android/base/resources/layout/browser_toolbar.xml
author Ryan VanderMeulen <ryanvm@gmail.com>
Fri, 15 Aug 2014 15:12:45 -0400
changeset 199784 d18d3e14ac3ebce527241cdc585c1f92aed1e818
parent 199780 9e0e63359e7755558a7c91063352d92b33bd6c6f
child 200026 0a0c695b4576da15069ccac5283f836eb5519716
permissions -rw-r--r--
Backed out 11 changesets (bug 1010740, bug 1054264, bug 1010739, bug 1042804, bug 1019035, bug 1010741, bug 1053884, bug 1054268) for frequent robocop failures. Backed out changeset 31d4832196f6 (bug 1054268) Backed out changeset 9e0e63359e77 (bug 1054264) Backed out changeset 5083e681191a (bug 1054264) Backed out changeset 7844cf23c521 (bug 1053884) Backed out changeset dd1a8ebbfae3 (bug 1042804) Backed out changeset e56bbc8b5bd0 (bug 1019035) Backed out changeset 6908f8780c29 (bug 1010740) Backed out changeset aaa50f34df6d (bug 1010740) Backed out changeset 8474627f88d5 (bug 1010739) Backed out changeset cbb72f0aa532 (bug 1010741) Backed out changeset 54179c9a121a (bug 1010741)

<?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">

    <ImageButton android:id="@+id/back"
                 style="@style/UrlBar.ImageButton.Unused"/>

    <ImageButton android:id="@+id/forward"
                 style="@style/UrlBar.ImageButton.Unused"/>

    <!-- Note: any layout parameters setting the right edge of
         this View should be matched in the url_bar_translating_edge.

         Note 2: On devices where the editing mode cancel button is
         wider than the tabs counter and nearby buttons, the url bar will
         shrink, in which case the LayoutParams of this View are
         changed dynamically. -->
    <ImageView android:id="@+id/url_bar_entry"
               style="@style/UrlBar.Button"
               android:layout_marginLeft="4dp"
               android:layout_marginRight="-15dp"
               android:layout_marginTop="5dp"
               android:layout_marginBottom="5dp"
               android:layout_centerVertical="true"
               android:layout_toLeftOf="@+id/tabs"
               android:duplicateParentState="true"
               android:clickable="false"
               android:focusable="false"
               android:src="@drawable/url_bar_entry"
               android:scaleType="fitXY"/>

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

    <LinearLayout android:id="@+id/menu_items"
                  style="@style/UrlBar.ImageButton.Unused"/>

    <org.mozilla.gecko.toolbar.ShapedButton android:id="@+id/menu"
                                            style="@style/UrlBar.ImageButton"
                                            android:layout_width="48dip"
                                            android:layout_alignParentRight="true"
                                            android:contentDescription="@string/menu"
                                            android:background="@drawable/shaped_button"
                                            android:visibility="gone"/>

    <org.mozilla.gecko.widget.ThemedImageView android:id="@+id/menu_icon"
                                              style="@style/UrlBar.ImageButton"
                                              android:layout_alignLeft="@id/menu"
                                              android:layout_alignRight="@id/menu"
                                              android:gravity="center_vertical"
                                              android:src="@drawable/menu_level"
                                              android:visibility="gone"/>

    <org.mozilla.gecko.toolbar.ShapedButton android:id="@+id/tabs"
                                            style="@style/UrlBar.ImageButton"
                                            android:layout_width="72dip"
                                            android:layout_toLeftOf="@id/menu"
                                            android:layout_alignWithParentIfMissing="true"
                                            gecko:curveTowards="right"
                                            android:background="@drawable/shaped_button"
                                            android:gravity="center_vertical"
                                            android:paddingLeft="37dip"
                                            android:paddingRight="11dip"/>

    <!-- The TextSwitcher should be shifted 24dp on the left, to avoid
         the curve. On a 48dp space, centering 24dp image will leave
         12dp on all sides. However this image has a perception of
         2 layers. Hence to center this, an additional 4dp is added to the left.
         The margins will be 40dp on left, 8dp on right, instead of ideal 30dp
         and 12dp. -->
    <org.mozilla.gecko.toolbar.TabCounter android:id="@+id/tabs_counter"
                        style="@style/UrlBar.ImageButton.TabCount"
                        android:layout_width="24dip"
                        android:layout_height="24dip"
                        android:layout_marginLeft="40dip"
                        android:layout_marginRight="8dip"
                        android:layout_marginTop="12dip"
                        android:layout_alignRight="@id/tabs"/>

    <!-- Note that the edit components are invisible so that the views
         depending on their location can properly layout. -->
    <org.mozilla.gecko.widget.ThemedImageView
            android:id="@+id/edit_cancel"
            style="@style/UrlBar.ImageButton.Icon"
            android:layout_alignParentRight="true"
            android:src="@drawable/close_edit_mode_selector"
            android:paddingLeft="2dp"
            android:paddingRight="2dp"
            android:contentDescription="@string/edit_mode_cancel"
            android:visibility="invisible"/>

    <!-- 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.Button"
                  android:layout_toLeftOf="@id/edit_cancel"
                  android:paddingLeft="12dp"
                  android:paddingRight="6dp"
                  android:visibility="invisible"/>

    <org.mozilla.gecko.toolbar.ToolbarDisplayLayout android:id="@+id/display_layout"
                  style="@style/UrlBar.Button"
                  android:layout_toLeftOf="@id/tabs"
                  android:layout_marginRight="-24dp"/>

    <ImageView android:id="@+id/shadow"
               android:layout_width="match_parent"
               android:layout_height="2dp"
               android:layout_alignParentBottom="true"
               android:background="@color/url_bar_shadow"
               android:contentDescription="@null"/>

</merge>