OLD | NEW |
(Empty) | |
| 1 <?xml version="1.0" encoding="utf-8"?> |
| 2 <!-- Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. --> |
| 5 |
| 6 <org.chromium.chrome.browser.ntp.NewTabPageView |
| 7 xmlns:android="http://schemas.android.com/apk/res/android" |
| 8 xmlns:chrome="http://schemas.android.com/apk/res-auto" |
| 9 android:layout_width="match_parent" |
| 10 android:layout_height="match_parent" |
| 11 android:paddingTop="@dimen/tab_strip_height" > |
| 12 |
| 13 <org.chromium.chrome.browser.ntp.NewTabScrollView |
| 14 android:id="@+id/ntp_scrollview" |
| 15 android:background="@color/ntp_bg" |
| 16 android:fillViewport="true" |
| 17 android:layout_width="match_parent" |
| 18 android:layout_height="match_parent" |
| 19 android:layout_marginBottom="48dp" |
| 20 android:focusable="true" |
| 21 android:focusableInTouchMode="true" |
| 22 android:contentDescription="@string/accessibility_new_tab_page" > |
| 23 |
| 24 <org.chromium.chrome.browser.ntp.NewTabPageLayout |
| 25 android:id="@+id/ntp_content" |
| 26 android:layout_width="match_parent" |
| 27 android:layout_height="match_parent" |
| 28 android:layout_gravity="center_horizontal" |
| 29 android:orientation="vertical" |
| 30 android:gravity="center" |
| 31 android:paddingTop="@dimen/toolbar_height_no_shadow" |
| 32 android:visibility="gone" |
| 33 chrome:maxWidth="692dp" > |
| 34 |
| 35 <!-- Spacer. Note: this must have layout_weight="1" and the other sp
acers must have |
| 36 layout_weight="0". The NewTabPageLayout will redistribute the e
xtra space between |
| 37 them. --> |
| 38 <View |
| 39 android:id="@+id/ntp_top_spacer" |
| 40 android:layout_width="0dp" |
| 41 android:layout_height="0dp" |
| 42 android:layout_weight="1" |
| 43 android:visibility="invisible" /> |
| 44 |
| 45 <!-- Search provider logo --> |
| 46 <org.chromium.chrome.browser.ntp.LogoView |
| 47 android:id="@+id/search_provider_logo" |
| 48 android:layout_width="wrap_content" |
| 49 android:layout_height="@dimen/ntp_logo_height" |
| 50 android:layout_marginStart="16dp" |
| 51 android:layout_marginEnd="16dp" |
| 52 android:layout_marginTop="26dp" |
| 53 android:layout_marginBottom="30dp" |
| 54 android:src="@drawable/google_logo" /> |
| 55 |
| 56 <!-- Search box --> |
| 57 <LinearLayout |
| 58 android:id="@+id/search_box" |
| 59 android:layout_width="match_parent" |
| 60 android:layout_height="48dp" |
| 61 android:layout_marginStart="12dp" |
| 62 android:layout_marginEnd="12dp" |
| 63 android:layout_marginBottom="8dp" |
| 64 android:gravity="center_vertical" |
| 65 android:background="@drawable/bg_ntp_search_box" |
| 66 android:orientation="horizontal" > |
| 67 <EditText |
| 68 android:id="@+id/search_box_text" |
| 69 android:layout_width="0dp" |
| 70 android:layout_height="match_parent" |
| 71 android:layout_marginStart="12dp" |
| 72 android:layout_weight="1" |
| 73 android:background="@null" |
| 74 android:ellipsize="end" |
| 75 android:focusableInTouchMode="false" |
| 76 android:gravity="center_vertical" |
| 77 android:inputType="text" |
| 78 android:singleLine="true" |
| 79 android:textSize="@dimen/location_bar_url_text_size" /> |
| 80 <org.chromium.chrome.browser.widget.TintedImageView |
| 81 android:id="@+id/voice_search_button" |
| 82 android:layout_width="wrap_content" |
| 83 android:layout_height="wrap_content" |
| 84 android:layout_marginStart="8dp" |
| 85 android:layout_marginEnd="8dp" |
| 86 android:contentDescription="@string/accessibility_toolbar_bt
n_mic" |
| 87 android:src="@drawable/btn_mic" /> |
| 88 </LinearLayout> |
| 89 |
| 90 <!-- Spacer --> |
| 91 <View |
| 92 android:id="@+id/ntp_middle_spacer" |
| 93 android:layout_width="0dp" |
| 94 android:layout_height="0dp" |
| 95 android:layout_weight="0" |
| 96 android:visibility="invisible" /> |
| 97 |
| 98 <!-- Document mode opt out promo --> |
| 99 <ViewStub |
| 100 android:id="@+id/opt_out_promo_stub" |
| 101 android:layout_width="match_parent" |
| 102 android:layout_height="wrap_content" |
| 103 android:inflatedId="@+id/opt_out_promo" |
| 104 android:layout="@layout/opt_out_promo" /> |
| 105 |
| 106 <!-- Most visited items. |
| 107 TODO(newt): inline the most visited items layout, instead of us
ing a ViewStub, |
| 108 once the layout is no longer controlled by a finch experiment.
--> |
| 109 <ViewStub |
| 110 android:id="@+id/most_visited_layout_stub" |
| 111 android:inflatedId="@+id/most_visited_layout" |
| 112 android:layout_width="wrap_content" |
| 113 android:layout_height="wrap_content" |
| 114 android:layout_marginBottom="16dp" |
| 115 android:layout_marginStart="16dp" |
| 116 android:layout_marginEnd="16dp" |
| 117 android:layout_gravity="center_horizontal" |
| 118 android:paddingTop="16dp" /> |
| 119 |
| 120 <!-- Most visited items placeholder --> |
| 121 <ViewStub |
| 122 android:id="@+id/most_visited_placeholder_stub" |
| 123 android:layout_width="match_parent" |
| 124 android:layout_height="wrap_content" |
| 125 android:layout_weight="1" |
| 126 android:inflatedId="@+id/most_visited_placeholder" |
| 127 android:layout="@layout/most_visited_placeholder" /> |
| 128 |
| 129 <!-- Spacer --> |
| 130 <View |
| 131 android:id="@+id/ntp_bottom_spacer" |
| 132 android:layout_width="0dp" |
| 133 android:layout_height="0dp" |
| 134 android:layout_weight="0" |
| 135 android:visibility="invisible" /> |
| 136 |
| 137 <View |
| 138 android:id="@+id/no_search_logo_spacer" |
| 139 android:layout_width="match_parent" |
| 140 android:layout_height="0dp" |
| 141 android:layout_weight="1" |
| 142 android:visibility="gone" /> |
| 143 |
| 144 <View |
| 145 android:id="@+id/ntp_scroll_spacer" |
| 146 android:layout_width="match_parent" |
| 147 android:layout_height="0dp" |
| 148 android:visibility="gone" /> |
| 149 </org.chromium.chrome.browser.ntp.NewTabPageLayout> |
| 150 </org.chromium.chrome.browser.ntp.NewTabScrollView> |
| 151 |
| 152 <!-- Bookmarks and Recent tabs buttons --> |
| 153 <org.chromium.chrome.browser.ntp.NewTabPageToolbar |
| 154 android:id="@+id/ntp_toolbar" |
| 155 android:background="#fff" |
| 156 android:layout_width="match_parent" |
| 157 android:layout_height="48dp" |
| 158 android:layout_gravity="bottom" |
| 159 android:orientation="horizontal" > |
| 160 <!-- Each button is a FrameLayout. Why? The TextView contains both text
and a compound |
| 161 drawable icon. If the TextView is half the screen width, the icon w
ill be at the left |
| 162 edge of the TextView even while the text is centered. To center the
icon along with the |
| 163 text, we need to set the TextView's width to wrap_content; but sinc
e the button needs |
| 164 to be half the screen width, we wrap the TextView in a FrameLayout,
whose width can |
| 165 expand as needed. --> |
| 166 <FrameLayout |
| 167 android:id="@+id/bookmarks_button" |
| 168 android:layout_width="0dp" |
| 169 android:layout_height="match_parent" |
| 170 android:layout_weight="1" |
| 171 android:background="?attr/listChoiceBackgroundIndicator" |
| 172 android:contentDescription="@string/accessibility_ntp_toolbar_btn_bo
okmarks" |
| 173 android:paddingTop="12dp" |
| 174 android:paddingBottom="12dp" > |
| 175 <TextView |
| 176 android:layout_width="wrap_content" |
| 177 android:layout_height="match_parent" |
| 178 android:layout_gravity="center_horizontal" |
| 179 android:drawablePadding="8dp" |
| 180 android:gravity="center_vertical" |
| 181 android:text="@string/ntp_bookmarks" |
| 182 android:textSize="12sp" |
| 183 android:textColor="#5a5a5a" /> |
| 184 </FrameLayout> |
| 185 <FrameLayout |
| 186 android:id="@+id/recent_tabs_button" |
| 187 android:layout_width="0dp" |
| 188 android:layout_height="match_parent" |
| 189 android:layout_weight="1" |
| 190 android:background="?attr/listChoiceBackgroundIndicator" |
| 191 android:contentDescription="@string/accessibility_ntp_toolbar_btn_re
cent_tabs" |
| 192 android:paddingTop="12dp" |
| 193 android:paddingBottom="12dp" > |
| 194 <TextView |
| 195 android:layout_width="wrap_content" |
| 196 android:layout_height="match_parent" |
| 197 android:layout_gravity="center_horizontal" |
| 198 android:drawablePadding="8dp" |
| 199 android:gravity="center_vertical" |
| 200 android:text="@string/recent_tabs" |
| 201 android:textSize="12sp" |
| 202 android:textColor="#5a5a5a" /> |
| 203 </FrameLayout> |
| 204 </org.chromium.chrome.browser.ntp.NewTabPageToolbar> |
| 205 </org.chromium.chrome.browser.ntp.NewTabPageView> |
OLD | NEW |