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

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

Issue 2808773002: Fixed ellipsize of publisher instead of timespan string. (Closed)
Patch Set: Refactor variable name. Created 3 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
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 <RelativeLayout 6 <RelativeLayout
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 xmlns:tools="http://schemas.android.com/tools" 9 xmlns:tools="http://schemas.android.com/tools"
10 android:id="@+id/snippets_card_view" 10 android:id="@+id/snippets_card_view"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 android:layout_marginTop="@dimen/snippets_publisher_margin_top_with_arti cle_snippet" 48 android:layout_marginTop="@dimen/snippets_publisher_margin_top_with_arti cle_snippet"
49 android:layout_alignParentStart="true" 49 android:layout_alignParentStart="true"
50 android:layout_below="@+id/article_snippet" 50 android:layout_below="@+id/article_snippet"
51 android:orientation="horizontal"> 51 android:orientation="horizontal">
52 52
53 <!-- The following attributes: 53 <!-- The following attributes:
54 - LinearLayout's android:layout_width="wrap_content" 54 - LinearLayout's android:layout_width="wrap_content"
55 - TextView's android:layout_width="0dp" 55 - TextView's android:layout_width="0dp"
56 - TextView's android:layout_weight="1" 56 - TextView's android:layout_weight="1"
57 All ensure that when the TextView is long and the ImageView is showing, the TextView starts 57 All ensure that when the TextView is long and the ImageView is showing, the TextView starts
58 to ellipsize before pushing the ImageView off the screen. See: https://c rbug.com/678568 --> 58 to ellipsize before pushing the ImageView off the screen. See: https://c rbug.com/678568 -->
dgn 2017/04/10 21:42:00 nit: update the description. The thing it would be
Galia 2017/04/11 15:54:32 Done.
59 <TextView 59 <TextView
60 android:id="@+id/article_publisher" 60 android:id="@+id/article_publisher"
61 android:layout_width="0dp" 61 android:layout_width="0dp"
62 android:layout_weight="1" 62 android:layout_weight="1"
63 android:layout_height="wrap_content" 63 android:layout_height="wrap_content"
64 android:drawablePadding="8dp" 64 android:drawablePadding="8dp"
65 android:paddingStart="4dp" 65 android:paddingStart="4dp"
66 android:maxLines="1" 66 android:maxLines="1"
67 android:ellipsize="end" 67 android:ellipsize="end"
68 android:textSize="12sp" 68 android:textSize="12sp"
69 android:textColor="@color/snippets_publisher_name_color" 69 android:textColor="@color/snippets_publisher_name_color"
70 android:textDirection="locale" /> 70 android:textDirection="locale" />
71 71
72 <!-- We need to have the publisher and the time span in separete TextVie ws to be able to
dgn 2017/04/10 21:42:00 s/separete/separate
Galia 2017/04/11 15:54:32 I'll remove that comment and explain all of this i
73 ellipsize the publisher instead of the time span.-->
dgn 2017/04/10 21:42:00 nit: + 4 spaces to align second line of comment wi
Bernhard Bauer 2017/04/10 23:03:03 Also, add a space before the end of the comment.
Galia 2017/04/11 15:54:31 Done.
74 <TextView
75 android:id="@+id/article_time"
dgn 2017/04/10 21:42:00 nit: I think something like article_age is more re
Galia 2017/04/11 15:54:31 Done.
76 android:layout_width="wrap_content"
77 android:layout_height="wrap_content"
78 android:drawablePadding="8dp"
dgn 2017/04/10 21:42:00 do you need the drawable padding here? when is it
Galia 2017/04/11 15:54:32 Removed. Thanks.
79 android:maxLines="1"
80 android:textSize="12sp"
81 android:textColor="@color/snippets_publisher_name_color"
82 android:textDirection="locale"/>
83
72 <!-- We can't add this ImageView as a CompoundDrawable to the TextView b ecause we want to 84 <!-- We can't add this ImageView as a CompoundDrawable to the TextView b ecause we want to
73 have different paddings between the favicon (which is a compound drawabl e on the TextView) 85 have different paddings between the favicon (which is a compound drawabl e on the TextView)
74 and the offline icon. --> 86 and the offline icon. -->
75 <org.chromium.chrome.browser.widget.TintedImageView 87 <org.chromium.chrome.browser.widget.TintedImageView
76 android:id="@+id/offline_icon" 88 android:id="@+id/offline_icon"
77 android:layout_width="@dimen/snippets_offline_icon_size" 89 android:layout_width="@dimen/snippets_offline_icon_size"
78 android:layout_height="@dimen/snippets_offline_icon_size" 90 android:layout_height="@dimen/snippets_offline_icon_size"
79 android:layout_marginStart="6dp" 91 android:layout_marginStart="6dp"
80 android:alpha="0.54" 92 android:alpha="0.54"
81 android:src="@drawable/offline_pin_round" 93 android:src="@drawable/offline_pin_round"
82 android:contentDescription="@string/accessibility_ntp_offline_badge" 94 android:contentDescription="@string/accessibility_ntp_offline_badge"
83 android:visibility="gone" 95 android:visibility="gone"
84 chrome:tint="#000" /> 96 chrome:tint="#000" />
85 97
86 </LinearLayout> 98 </LinearLayout>
87 99
88 <org.chromium.chrome.browser.widget.TintedImageView 100 <org.chromium.chrome.browser.widget.TintedImageView
89 android:id="@+id/article_thumbnail" 101 android:id="@+id/article_thumbnail"
90 android:layout_width="@dimen/snippets_thumbnail_size" 102 android:layout_width="@dimen/snippets_thumbnail_size"
91 android:layout_height="@dimen/snippets_thumbnail_size" 103 android:layout_height="@dimen/snippets_thumbnail_size"
92 android:layout_alignParentTop="true" 104 android:layout_alignParentTop="true"
93 android:layout_alignParentEnd="true" 105 android:layout_alignParentEnd="true"
94 android:layout_marginStart="@dimen/snippets_thumbnail_margin" 106 android:layout_marginStart="@dimen/snippets_thumbnail_margin"
95 android:scaleType="centerCrop" 107 android:scaleType="centerCrop"
96 android:contentDescription="@null" 108 android:contentDescription="@null"
97 android:src="@null" /> 109 android:src="@null" />
98 </RelativeLayout> 110 </RelativeLayout>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698