mobile/android/base/resources/layout/browser_toolbar.xml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <?xml version="1.0" encoding="utf-8"?>
     2 <!-- This Source Code Form is subject to the terms of the Mozilla Public
     3    - License, v. 2.0. If a copy of the MPL was not distributed with this
     4    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
     6 <merge xmlns:android="http://schemas.android.com/apk/res/android"
     7        xmlns:gecko="http://schemas.android.com/apk/res-auto">
     9     <ImageButton android:id="@+id/back"
    10                  style="@style/UrlBar.ImageButton.Unused"/>
    12     <ImageButton android:id="@+id/forward"
    13                  style="@style/UrlBar.ImageButton.Unused"/>
    15     <!-- Note: any layout parameters setting the right edge of
    16          this View should be matched in the url_bar_translating_edge.
    18          Note 2: On devices where the editing mode cancel button is
    19          wider than the tabs counter and nearby buttons, the url bar will
    20          shrink, in which case the LayoutParams of this View are
    21          changed dynamically. -->
    22     <ImageView android:id="@+id/url_bar_entry"
    23                style="@style/UrlBar.Button"
    24                android:layout_marginLeft="4dp"
    25                android:layout_marginRight="-15dp"
    26                android:layout_marginTop="5dp"
    27                android:layout_marginBottom="5dp"
    28                android:layout_centerVertical="true"
    29                android:layout_toLeftOf="@+id/tabs"
    30                android:duplicateParentState="true"
    31                android:clickable="false"
    32                android:focusable="false"
    33                android:src="@drawable/url_bar_entry"
    34                android:scaleType="fitXY"/>
    36     <!-- A View that clips with url_bar_entry and translates
    37          around it to animate shrinking or growing the url bar,
    38          which occurs in the display/editing mode transitions. -->
    39     <ImageView android:id="@+id/url_bar_translating_edge"
    40                style="@style/UrlBar.Button"
    41                android:layout_alignLeft="@id/url_bar_entry"
    42                android:layout_toLeftOf="@+id/tabs"
    43                android:layout_alignTop="@id/url_bar_entry"
    44                android:layout_alignBottom="@id/url_bar_entry"
    45                android:layout_marginRight="-15dp"
    46                android:duplicateParentState="true"
    47                android:clickable="false"
    48                android:focusable="false"
    49                android:visibility="invisible"
    50                android:src="@drawable/url_bar_translating_edge"
    51                android:scaleType="fitXY"/>
    53     <LinearLayout android:id="@+id/menu_items"
    54                   style="@style/UrlBar.ImageButton.Unused"/>
    56     <org.mozilla.gecko.toolbar.ShapedButton android:id="@+id/menu"
    57                                             style="@style/UrlBar.ImageButton"
    58                                             android:layout_width="48dip"
    59                                             android:layout_alignParentRight="true"
    60                                             android:contentDescription="@string/menu"
    61                                             android:background="@drawable/shaped_button"
    62                                             android:visibility="gone"/>
    64     <org.mozilla.gecko.widget.ThemedImageView android:id="@+id/menu_icon"
    65                                               style="@style/UrlBar.ImageButton"
    66                                               android:layout_alignLeft="@id/menu"
    67                                               android:layout_alignRight="@id/menu"
    68                                               android:gravity="center_vertical"
    69                                               android:src="@drawable/menu_level"
    70                                               android:visibility="gone"/>
    72     <org.mozilla.gecko.toolbar.ShapedButton android:id="@+id/tabs"
    73                                             style="@style/UrlBar.ImageButton"
    74                                             android:layout_width="72dip"
    75                                             android:layout_toLeftOf="@id/menu"
    76                                             android:layout_alignWithParentIfMissing="true"
    77                                             gecko:curveTowards="right"
    78                                             android:background="@drawable/shaped_button"
    79                                             android:gravity="center_vertical"
    80                                             android:paddingLeft="37dip"
    81                                             android:paddingRight="11dip"/>
    83     <!-- The TextSwitcher should be shifted 24dp on the left, to avoid
    84          the curve. On a 48dp space, centering 24dp image will leave
    85          12dp on all sides. However this image has a perception of
    86          2 layers. Hence to center this, an additional 4dp is added to the left.
    87          The margins will be 40dp on left, 8dp on right, instead of ideal 30dp
    88          and 12dp. -->
    89     <org.mozilla.gecko.toolbar.TabCounter android:id="@+id/tabs_counter"
    90                         style="@style/UrlBar.ImageButton.TabCount"
    91                         android:layout_width="24dip"
    92                         android:layout_height="24dip"
    93                         android:layout_marginLeft="40dip"
    94                         android:layout_marginRight="8dip"
    95                         android:layout_marginTop="12dip"
    96                         android:layout_alignRight="@id/tabs"/>
    98     <!-- Note that the edit components are invisible so that the views
    99          depending on their location can properly layout. -->
   100     <org.mozilla.gecko.widget.ThemedImageView
   101             android:id="@+id/edit_cancel"
   102             style="@style/UrlBar.ImageButton.Icon"
   103             android:layout_alignParentRight="true"
   104             android:src="@drawable/close_edit_mode_selector"
   105             android:paddingLeft="2dp"
   106             android:paddingRight="2dp"
   107             android:contentDescription="@string/edit_mode_cancel"
   108             android:visibility="invisible"/>
   110     <!-- The left margin of the cancel button is larger than the right because
   111          the url bar drawable contains some whitespace, so we compensate by adding
   112          a negative right margin (value determined through experimentation). -->
   113     <org.mozilla.gecko.toolbar.ToolbarEditLayout android:id="@+id/edit_layout"
   114                   style="@style/UrlBar.Button"
   115                   android:layout_toLeftOf="@id/edit_cancel"
   116                   android:layout_marginLeft="4dp"
   117                   android:layout_marginRight="-2dp"
   118                   android:paddingLeft="8dp"
   119                   android:paddingRight="8dp"
   120                   android:visibility="invisible"/>
   122     <org.mozilla.gecko.toolbar.ToolbarDisplayLayout android:id="@+id/display_layout"
   123                   style="@style/UrlBar.Button"
   124                   android:layout_toLeftOf="@id/tabs"
   125                   android:layout_marginRight="-24dp"/>
   127     <ImageView android:id="@+id/shadow"
   128                android:layout_width="fill_parent"
   129                android:layout_height="2dp"
   130                android:layout_alignParentBottom="true"
   131                android:background="@color/url_bar_shadow"
   132                android:contentDescription="@null"/>
   134 </merge>

mercurial