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

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: LTR in Jelly Bean works. RTL wrong order, but correct formatting. 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java » ('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 <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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 tools:ignore="UseCompoundDrawables" 44 tools:ignore="UseCompoundDrawables"
45 android:id="@+id/publisher_bar" 45 android:id="@+id/publisher_bar"
46 android:layout_width="wrap_content" 46 android:layout_width="wrap_content"
47 android:layout_height="wrap_content" 47 android:layout_height="wrap_content"
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 - article_publisher's android:layout_width="0dp"
56 - TextView's android:layout_weight="1" 56 - article_publisher's android:layout_weight="1"
57 All ensure that when the TextView is long and the ImageView is showing, the TextView starts 57 - article_publisher's android:ellipsize="end"
58 to ellipsize before pushing the ImageView off the screen. See: https://c rbug.com/678568 --> 58 - article_age's android:layout_width="wrap_content"
59 All ensure that when the publisher string is long, it starts to ell ipsize before
60 pushing the article age string and the offline icon off the screen.
61 See: https://crbug.com/625775 and https://crbug.com/678568 -->
59 <TextView 62 <TextView
60 android:id="@+id/article_publisher" 63 android:id="@+id/article_publisher"
61 android:layout_width="0dp" 64 android:layout_width="0dp"
62 android:layout_weight="1" 65 android:layout_weight="1"
63 android:layout_height="wrap_content" 66 android:layout_height="wrap_content"
64 android:drawablePadding="8dp" 67 android:drawablePadding="8dp"
65 android:paddingStart="4dp" 68 android:paddingStart="4dp"
66 android:maxLines="1" 69 android:maxLines="1"
70 android:singleLine="true"
67 android:ellipsize="end" 71 android:ellipsize="end"
68 android:textSize="12sp" 72 android:textSize="12sp"
69 android:textColor="@color/snippets_publisher_name_color" 73 android:textColor="@color/snippets_publisher_name_color"
70 android:textDirection="locale" /> 74 android:textDirection="locale" />
75 <TextView
76 android:id="@+id/article_age"
77 android:layout_width="wrap_content"
78 android:layout_height="wrap_content"
79 android:maxLines="1"
80 android:textSize="12sp"
81 android:textColor="@color/snippets_publisher_name_color"
82 android:textDirection="locale"/>
71 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 dr awable on the
74 and the offline icon. --> 86 TextView) 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698