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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial