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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/res/layout/new_tab_page_snippets_card.xml
diff --git a/chrome/android/java/res/layout/new_tab_page_snippets_card.xml b/chrome/android/java/res/layout/new_tab_page_snippets_card.xml
index c556447dab9cab1e0784b8274b586d4eb5ea32bd..8293159c8abb486f49077555327eb4534a4c977e 100644
--- a/chrome/android/java/res/layout/new_tab_page_snippets_card.xml
+++ b/chrome/android/java/res/layout/new_tab_page_snippets_card.xml
@@ -51,11 +51,14 @@
android:orientation="horizontal">
<!-- The following attributes:
- - LinearLayout's android:layout_width="wrap_content"
- - TextView's android:layout_width="0dp"
- - TextView's android:layout_weight="1"
- All ensure that when the TextView is long and the ImageView is showing, the TextView starts
- to ellipsize before pushing the ImageView off the screen. See: https://crbug.com/678568 -->
+ - LinearLayout's android:layout_width="wrap_content"
+ - article_publisher's android:layout_width="0dp"
+ - article_publisher's android:layout_weight="1"
+ - article_publisher's android:ellipsize="end"
+ - article_age's android:layout_width="wrap_content"
+ All ensure that when the publisher string is long, it starts to ellipsize before
+ pushing the article age string and the offline icon off the screen.
+ See: https://crbug.com/625775 and https://crbug.com/678568 -->
<TextView
android:id="@+id/article_publisher"
android:layout_width="0dp"
@@ -64,14 +67,23 @@
android:drawablePadding="8dp"
android:paddingStart="4dp"
android:maxLines="1"
+ android:singleLine="true"
android:ellipsize="end"
android:textSize="12sp"
android:textColor="@color/snippets_publisher_name_color"
android:textDirection="locale" />
+ <TextView
+ android:id="@+id/article_age"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:maxLines="1"
+ android:textSize="12sp"
+ android:textColor="@color/snippets_publisher_name_color"
+ android:textDirection="locale"/>
<!-- We can't add this ImageView as a CompoundDrawable to the TextView because we want to
- have different paddings between the favicon (which is a compound drawable on the TextView)
- and the offline icon. -->
+ have different paddings between the favicon (which is a compound drawable on the
+ TextView) and the offline icon. -->
<org.chromium.chrome.browser.widget.TintedImageView
android:id="@+id/offline_icon"
android:layout_width="@dimen/snippets_offline_icon_size"
« 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