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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/resources/layout/browser_toolbar.xml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,134 @@
     1.4 +<?xml version="1.0" encoding="utf-8"?>
     1.5 +<!-- This Source Code Form is subject to the terms of the Mozilla Public
     1.6 +   - License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 +   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
     1.8 +
     1.9 +<merge xmlns:android="http://schemas.android.com/apk/res/android"
    1.10 +       xmlns:gecko="http://schemas.android.com/apk/res-auto">
    1.11 +
    1.12 +    <ImageButton android:id="@+id/back"
    1.13 +                 style="@style/UrlBar.ImageButton.Unused"/>
    1.14 +
    1.15 +    <ImageButton android:id="@+id/forward"
    1.16 +                 style="@style/UrlBar.ImageButton.Unused"/>
    1.17 +
    1.18 +    <!-- Note: any layout parameters setting the right edge of
    1.19 +         this View should be matched in the url_bar_translating_edge.
    1.20 +
    1.21 +         Note 2: On devices where the editing mode cancel button is
    1.22 +         wider than the tabs counter and nearby buttons, the url bar will
    1.23 +         shrink, in which case the LayoutParams of this View are
    1.24 +         changed dynamically. -->
    1.25 +    <ImageView android:id="@+id/url_bar_entry"
    1.26 +               style="@style/UrlBar.Button"
    1.27 +               android:layout_marginLeft="4dp"
    1.28 +               android:layout_marginRight="-15dp"
    1.29 +               android:layout_marginTop="5dp"
    1.30 +               android:layout_marginBottom="5dp"
    1.31 +               android:layout_centerVertical="true"
    1.32 +               android:layout_toLeftOf="@+id/tabs"
    1.33 +               android:duplicateParentState="true"
    1.34 +               android:clickable="false"
    1.35 +               android:focusable="false"
    1.36 +               android:src="@drawable/url_bar_entry"
    1.37 +               android:scaleType="fitXY"/>
    1.38 +
    1.39 +    <!-- A View that clips with url_bar_entry and translates
    1.40 +         around it to animate shrinking or growing the url bar,
    1.41 +         which occurs in the display/editing mode transitions. -->
    1.42 +    <ImageView android:id="@+id/url_bar_translating_edge"
    1.43 +               style="@style/UrlBar.Button"
    1.44 +               android:layout_alignLeft="@id/url_bar_entry"
    1.45 +               android:layout_toLeftOf="@+id/tabs"
    1.46 +               android:layout_alignTop="@id/url_bar_entry"
    1.47 +               android:layout_alignBottom="@id/url_bar_entry"
    1.48 +               android:layout_marginRight="-15dp"
    1.49 +               android:duplicateParentState="true"
    1.50 +               android:clickable="false"
    1.51 +               android:focusable="false"
    1.52 +               android:visibility="invisible"
    1.53 +               android:src="@drawable/url_bar_translating_edge"
    1.54 +               android:scaleType="fitXY"/>
    1.55 +
    1.56 +    <LinearLayout android:id="@+id/menu_items"
    1.57 +                  style="@style/UrlBar.ImageButton.Unused"/>
    1.58 +
    1.59 +    <org.mozilla.gecko.toolbar.ShapedButton android:id="@+id/menu"
    1.60 +                                            style="@style/UrlBar.ImageButton"
    1.61 +                                            android:layout_width="48dip"
    1.62 +                                            android:layout_alignParentRight="true"
    1.63 +                                            android:contentDescription="@string/menu"
    1.64 +                                            android:background="@drawable/shaped_button"
    1.65 +                                            android:visibility="gone"/>
    1.66 +
    1.67 +    <org.mozilla.gecko.widget.ThemedImageView android:id="@+id/menu_icon"
    1.68 +                                              style="@style/UrlBar.ImageButton"
    1.69 +                                              android:layout_alignLeft="@id/menu"
    1.70 +                                              android:layout_alignRight="@id/menu"
    1.71 +                                              android:gravity="center_vertical"
    1.72 +                                              android:src="@drawable/menu_level"
    1.73 +                                              android:visibility="gone"/>
    1.74 +
    1.75 +    <org.mozilla.gecko.toolbar.ShapedButton android:id="@+id/tabs"
    1.76 +                                            style="@style/UrlBar.ImageButton"
    1.77 +                                            android:layout_width="72dip"
    1.78 +                                            android:layout_toLeftOf="@id/menu"
    1.79 +                                            android:layout_alignWithParentIfMissing="true"
    1.80 +                                            gecko:curveTowards="right"
    1.81 +                                            android:background="@drawable/shaped_button"
    1.82 +                                            android:gravity="center_vertical"
    1.83 +                                            android:paddingLeft="37dip"
    1.84 +                                            android:paddingRight="11dip"/>
    1.85 +
    1.86 +    <!-- The TextSwitcher should be shifted 24dp on the left, to avoid
    1.87 +         the curve. On a 48dp space, centering 24dp image will leave
    1.88 +         12dp on all sides. However this image has a perception of
    1.89 +         2 layers. Hence to center this, an additional 4dp is added to the left.
    1.90 +         The margins will be 40dp on left, 8dp on right, instead of ideal 30dp
    1.91 +         and 12dp. -->
    1.92 +    <org.mozilla.gecko.toolbar.TabCounter android:id="@+id/tabs_counter"
    1.93 +                        style="@style/UrlBar.ImageButton.TabCount"
    1.94 +                        android:layout_width="24dip"
    1.95 +                        android:layout_height="24dip"
    1.96 +                        android:layout_marginLeft="40dip"
    1.97 +                        android:layout_marginRight="8dip"
    1.98 +                        android:layout_marginTop="12dip"
    1.99 +                        android:layout_alignRight="@id/tabs"/>
   1.100 +
   1.101 +    <!-- Note that the edit components are invisible so that the views
   1.102 +         depending on their location can properly layout. -->
   1.103 +    <org.mozilla.gecko.widget.ThemedImageView
   1.104 +            android:id="@+id/edit_cancel"
   1.105 +            style="@style/UrlBar.ImageButton.Icon"
   1.106 +            android:layout_alignParentRight="true"
   1.107 +            android:src="@drawable/close_edit_mode_selector"
   1.108 +            android:paddingLeft="2dp"
   1.109 +            android:paddingRight="2dp"
   1.110 +            android:contentDescription="@string/edit_mode_cancel"
   1.111 +            android:visibility="invisible"/>
   1.112 +
   1.113 +    <!-- The left margin of the cancel button is larger than the right because
   1.114 +         the url bar drawable contains some whitespace, so we compensate by adding
   1.115 +         a negative right margin (value determined through experimentation). -->
   1.116 +    <org.mozilla.gecko.toolbar.ToolbarEditLayout android:id="@+id/edit_layout"
   1.117 +                  style="@style/UrlBar.Button"
   1.118 +                  android:layout_toLeftOf="@id/edit_cancel"
   1.119 +                  android:layout_marginLeft="4dp"
   1.120 +                  android:layout_marginRight="-2dp"
   1.121 +                  android:paddingLeft="8dp"
   1.122 +                  android:paddingRight="8dp"
   1.123 +                  android:visibility="invisible"/>
   1.124 +
   1.125 +    <org.mozilla.gecko.toolbar.ToolbarDisplayLayout android:id="@+id/display_layout"
   1.126 +                  style="@style/UrlBar.Button"
   1.127 +                  android:layout_toLeftOf="@id/tabs"
   1.128 +                  android:layout_marginRight="-24dp"/>
   1.129 +
   1.130 +    <ImageView android:id="@+id/shadow"
   1.131 +               android:layout_width="fill_parent"
   1.132 +               android:layout_height="2dp"
   1.133 +               android:layout_alignParentBottom="true"
   1.134 +               android:background="@color/url_bar_shadow"
   1.135 +               android:contentDescription="@null"/>
   1.136 +
   1.137 +</merge>

mercurial