Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: chrome/android/java/res/layout/new_tab_page.xml

Issue 1833763002: Add new NTP layout with snippet cards and hide it behind a flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address more comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/android/java/res/layout/new_tab_page_incognito.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
9 android:layout_width="match_parent" 8 android:layout_width="match_parent"
10 android:layout_height="match_parent" 9 android:layout_height="match_parent"
11 android:paddingTop="@dimen/tab_strip_height" > 10 android:paddingTop="@dimen/tab_strip_height" >
12 11
13 <org.chromium.chrome.browser.ntp.NewTabScrollView 12 <ViewStub
14 android:id="@+id/ntp_scrollview" 13 android:id="@+id/new_tab_page_layout_stub"
15 android:background="@color/ntp_bg" 14 android:inflatedId="@+id/ntp_scrollview"
16 android:fillViewport="true"
17 android:layout_width="match_parent" 15 android:layout_width="match_parent"
18 android:layout_height="match_parent" 16 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 <!-- Most visited items -->
99 <org.chromium.chrome.browser.ntp.MostVisitedLayout
100 android:id="@+id/most_visited_layout"
101 android:layout_width="wrap_content"
102 android:layout_height="wrap_content"
103 android:layout_marginBottom="16dp"
104 android:layout_marginStart="12dp"
105 android:layout_marginEnd="12dp"
106 android:layout_gravity="center_horizontal"
107 android:paddingTop="@dimen/most_visited_layout_padding_top"
108 android:paddingBottom="4dp" />
109
110 <!-- Most visited items placeholder -->
111 <ViewStub
112 android:id="@+id/most_visited_placeholder_stub"
113 android:layout_width="match_parent"
114 android:layout_height="wrap_content"
115 android:layout_weight="1"
116 android:inflatedId="@+id/most_visited_placeholder"
117 android:layout="@layout/most_visited_placeholder" />
118
119 <android.support.v7.widget.RecyclerView
120 android:id="@+id/snippets_card_list"
121 android:scrollbars="none"
122 android:visibility="gone"
123 android:layout_width="match_parent"
124 android:layout_height="wrap_content"/>
125
126 <!-- Spacer -->
127 <View
128 android:id="@+id/ntp_bottom_spacer"
129 android:layout_width="0dp"
130 android:layout_height="0dp"
131 android:layout_weight="0"
132 android:visibility="invisible" />
133
134 <View
135 android:id="@+id/no_search_logo_spacer"
136 android:layout_width="match_parent"
137 android:layout_height="0dp"
138 android:layout_weight="1"
139 android:visibility="gone" />
140
141 <View
142 android:id="@+id/ntp_scroll_spacer"
143 android:layout_width="match_parent"
144 android:layout_height="0dp"
145 android:visibility="gone" />
146 </org.chromium.chrome.browser.ntp.NewTabPageLayout>
147 </org.chromium.chrome.browser.ntp.NewTabScrollView>
148 17
149 <!-- Bookmarks and Recent tabs buttons --> 18 <!-- Bookmarks and Recent tabs buttons -->
150 <org.chromium.chrome.browser.ntp.NewTabPageToolbar 19 <org.chromium.chrome.browser.ntp.NewTabPageToolbar
151 android:id="@+id/ntp_toolbar" 20 android:id="@+id/ntp_toolbar"
152 android:background="#fff" 21 android:background="@color/ntp_bg"
153 android:layout_width="match_parent" 22 android:layout_width="match_parent"
154 android:layout_height="48dp" 23 android:layout_height="48dp"
155 android:layout_gravity="bottom" 24 android:layout_gravity="bottom"
156 android:orientation="horizontal" > 25 android:orientation="horizontal" >
157 <!-- Each button is a FrameLayout. Why? The TextView contains both text and a compound 26 <!-- Each button is a FrameLayout. Why? The TextView contains both text and a compound
158 drawable icon. If the TextView is half the screen width, the icon w ill be at the left 27 drawable icon. If the TextView is half the screen width, the icon w ill be at the left
159 edge of the TextView even while the text is centered. To center the icon along with the 28 edge of the TextView even while the text is centered. To center the icon along with the
160 text, we need to set the TextView's width to wrap_content; but sinc e the button needs 29 text, we need to set the TextView's width to wrap_content; but sinc e the button needs
161 to be half the screen width, we wrap the TextView in a FrameLayout, whose width can 30 to be half the screen width, we wrap the TextView in a FrameLayout, whose width can
162 expand as needed. --> 31 expand as needed. -->
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 android:layout_height="match_parent" 82 android:layout_height="match_parent"
214 android:layout_gravity="center_horizontal" 83 android:layout_gravity="center_horizontal"
215 android:drawablePadding="8dp" 84 android:drawablePadding="8dp"
216 android:gravity="center_vertical" 85 android:gravity="center_vertical"
217 android:text="@string/recent_tabs" 86 android:text="@string/recent_tabs"
218 android:textSize="12sp" 87 android:textSize="12sp"
219 android:textColor="#5a5a5a" /> 88 android:textColor="#5a5a5a" />
220 </FrameLayout> 89 </FrameLayout>
221 </org.chromium.chrome.browser.ntp.NewTabPageToolbar> 90 </org.chromium.chrome.browser.ntp.NewTabPageToolbar>
222 </org.chromium.chrome.browser.ntp.NewTabPageView> 91 </org.chromium.chrome.browser.ntp.NewTabPageView>
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/res/layout/new_tab_page_incognito.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698