OLD | NEW |
1 <?xml version="1.0" encoding="utf-8"?> | 1 <?xml version="1.0" encoding="utf-8"?> |
2 <!-- Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. --> | 4 found in the LICENSE file. --> |
5 | 5 |
6 <org.chromium.chrome.browser.ntp.NewTabPageView | 6 <org.chromium.chrome.browser.ntp.NewTabPageView |
7 xmlns:android="http://schemas.android.com/apk/res/android" | 7 xmlns:android="http://schemas.android.com/apk/res/android" |
8 xmlns:chrome="http://schemas.android.com/apk/res-auto" | 8 xmlns:chrome="http://schemas.android.com/apk/res-auto" |
9 android:layout_width="match_parent" | 9 android:layout_width="match_parent" |
10 android:layout_height="match_parent" | 10 android:layout_height="match_parent" |
11 android:paddingTop="@dimen/tab_strip_height" > | 11 android:paddingTop="@dimen/tab_strip_height" > |
12 | 12 |
13 <org.chromium.chrome.browser.ntp.NewTabScrollView | 13 <ViewStub |
14 android:id="@+id/ntp_scrollview" | 14 android:id="@+id/new_tab_page_layout_stub" |
15 android:background="@color/ntp_bg" | 15 android:inflatedId="@+id/ntp_scrollview" |
16 android:fillViewport="true" | |
17 android:layout_width="match_parent" | 16 android:layout_width="match_parent" |
18 android:layout_height="match_parent" | 17 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 <org.chromium.chrome.browser.ntp.MostVisitedLayout | |
108 android:id="@+id/most_visited_layout" | |
109 android:layout_width="wrap_content" | |
110 android:layout_height="wrap_content" | |
111 android:layout_marginBottom="16dp" | |
112 android:layout_marginStart="12dp" | |
113 android:layout_marginEnd="12dp" | |
114 android:layout_gravity="center_horizontal" | |
115 android:paddingTop="@dimen/most_visited_layout_padding_top" | |
116 android:paddingBottom="4dp" /> | |
117 | |
118 <!-- Most visited items placeholder --> | |
119 <ViewStub | |
120 android:id="@+id/most_visited_placeholder_stub" | |
121 android:layout_width="match_parent" | |
122 android:layout_height="wrap_content" | |
123 android:layout_weight="1" | |
124 android:inflatedId="@+id/most_visited_placeholder" | |
125 android:layout="@layout/most_visited_placeholder" /> | |
126 | |
127 <android.support.v7.widget.RecyclerView | |
128 android:id="@+id/snippets_card_list" | |
129 android:scrollbars="none" | |
130 android:visibility="gone" | |
131 android:layout_width="match_parent" | |
132 android:layout_height="wrap_content"/> | |
133 | |
134 <!-- Spacer --> | |
135 <View | |
136 android:id="@+id/ntp_bottom_spacer" | |
137 android:layout_width="0dp" | |
138 android:layout_height="0dp" | |
139 android:layout_weight="0" | |
140 android:visibility="invisible" /> | |
141 | |
142 <View | |
143 android:id="@+id/no_search_logo_spacer" | |
144 android:layout_width="match_parent" | |
145 android:layout_height="0dp" | |
146 android:layout_weight="1" | |
147 android:visibility="gone" /> | |
148 | |
149 <View | |
150 android:id="@+id/ntp_scroll_spacer" | |
151 android:layout_width="match_parent" | |
152 android:layout_height="0dp" | |
153 android:visibility="gone" /> | |
154 </org.chromium.chrome.browser.ntp.NewTabPageLayout> | |
155 </org.chromium.chrome.browser.ntp.NewTabScrollView> | |
156 | 18 |
157 <!-- Bookmarks and Recent tabs buttons --> | 19 <!-- Bookmarks and Recent tabs buttons --> |
158 <org.chromium.chrome.browser.ntp.NewTabPageToolbar | 20 <org.chromium.chrome.browser.ntp.NewTabPageToolbar |
159 android:id="@+id/ntp_toolbar" | 21 android:id="@+id/ntp_toolbar" |
160 android:background="#fff" | 22 android:background="@color/ntp_bg" |
161 android:layout_width="match_parent" | 23 android:layout_width="match_parent" |
162 android:layout_height="48dp" | 24 android:layout_height="48dp" |
163 android:layout_gravity="bottom" | 25 android:layout_gravity="bottom" |
164 android:orientation="horizontal" > | 26 android:orientation="horizontal" > |
165 <!-- Each button is a FrameLayout. Why? The TextView contains both text
and a compound | 27 <!-- Each button is a FrameLayout. Why? The TextView contains both text
and a compound |
166 drawable icon. If the TextView is half the screen width, the icon w
ill be at the left | 28 drawable icon. If the TextView is half the screen width, the icon w
ill be at the left |
167 edge of the TextView even while the text is centered. To center the
icon along with the | 29 edge of the TextView even while the text is centered. To center the
icon along with the |
168 text, we need to set the TextView's width to wrap_content; but sinc
e the button needs | 30 text, we need to set the TextView's width to wrap_content; but sinc
e the button needs |
169 to be half the screen width, we wrap the TextView in a FrameLayout,
whose width can | 31 to be half the screen width, we wrap the TextView in a FrameLayout,
whose width can |
170 expand as needed. --> | 32 expand as needed. --> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 android:layout_height="match_parent" | 83 android:layout_height="match_parent" |
222 android:layout_gravity="center_horizontal" | 84 android:layout_gravity="center_horizontal" |
223 android:drawablePadding="8dp" | 85 android:drawablePadding="8dp" |
224 android:gravity="center_vertical" | 86 android:gravity="center_vertical" |
225 android:text="@string/recent_tabs" | 87 android:text="@string/recent_tabs" |
226 android:textSize="12sp" | 88 android:textSize="12sp" |
227 android:textColor="#5a5a5a" /> | 89 android:textColor="#5a5a5a" /> |
228 </FrameLayout> | 90 </FrameLayout> |
229 </org.chromium.chrome.browser.ntp.NewTabPageToolbar> | 91 </org.chromium.chrome.browser.ntp.NewTabPageToolbar> |
230 </org.chromium.chrome.browser.ntp.NewTabPageView> | 92 </org.chromium.chrome.browser.ntp.NewTabPageView> |
OLD | NEW |