Bug 1082110 - Polish appearance of new reading list style. r=mcomella
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 29 Oct 2014 15:34:38 -0700
changeset 229298 c0a39c3bee2e9b63196f21573bb1247796ea74e2
parent 229297 cf2ccaa2ec7931f3d5498a7d496f4bcaf77a26e3
child 229299 1ca37db5609f9d511791b9100ac9c7511cd80843
push id7326
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:58:42 +0000
treeherdermozilla-aurora@d3a3b2a0f2f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1082110
milestone36.0a1
Bug 1082110 - Polish appearance of new reading list style. r=mcomella
mobile/android/base/home/ReadingListRow.java
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/resources/layout/reading_list_item_row.xml
mobile/android/base/resources/layout/reading_list_row_view.xml
mobile/android/base/resources/values-large-v11/dimens.xml
mobile/android/base/resources/values-large-v11/styles.xml
mobile/android/base/resources/values-v16/styles.xml
mobile/android/base/resources/values/dimens.xml
mobile/android/base/resources/values/styles.xml
mobile/android/base/strings.xml.in
--- a/mobile/android/base/home/ReadingListRow.java
+++ b/mobile/android/base/home/ReadingListRow.java
@@ -38,18 +38,16 @@ public class ReadingListRow extends Line
         this(context, null);
     }
 
     public ReadingListRow(Context context, AttributeSet attrs) {
         super(context, attrs);
 
         LayoutInflater.from(context).inflate(R.layout.reading_list_row_view, this);
 
-        setOrientation(LinearLayout.VERTICAL);
-
         resources = context.getResources();
 
         title = (TextView) findViewById(R.id.title);
         excerpt = (TextView) findViewById(R.id.excerpt);
         readTime = (TextView) findViewById(R.id.read_time);
     }
 
     public void updateFromCursor(Cursor cursor) {
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -355,20 +355,20 @@ size. -->
      dialog that appears after selecting the "Edit Site Settings" context menu item. -->
 <!ENTITY site_settings_title3       "Site Settings">
 <!ENTITY site_settings_cancel       "Cancel">
 <!ENTITY site_settings_clear        "Clear">
 <!ENTITY site_settings_no_settings  "There are no settings to clear.">
 
 <!ENTITY reading_list_added "Page added to your Reading List">
 
-<!-- Localization note (reading_list_time_minutes) : This string is used in the "Reading List"
+<!-- Localization note (reading_list_time_minutes2) : This string is used in the "Reading List"
      panel on the home page to give the user an estimate of how many minutes it will take to
      read an article. The word "minute" should be abbreviated if possible. -->
-<!ENTITY reading_list_time_minutes "&formatD;min">
+<!ENTITY reading_list_time_minutes2 "&formatD; min">
 <!ENTITY reading_list_time_over_an_hour "Over an hour">
 
 <!-- Localization note : These strings are used as alternate text for accessibility.
      They are not visible in the UI. -->
 <!ENTITY page_action_dropmarker_description "Additional Actions">
 
 <!ENTITY masterpassword_create_title "Create Master Password">
 <!ENTITY masterpassword_remove_title "Remove Master Password">
--- a/mobile/android/base/resources/layout/reading_list_item_row.xml
+++ b/mobile/android/base/resources/layout/reading_list_item_row.xml
@@ -1,10 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <org.mozilla.gecko.home.ReadingListRow xmlns:android="http://schemas.android.com/apk/res/android"
-                                       style="@style/Widget.BookmarkItemView"
                                        android:layout_width="match_parent"
-                                       android:layout_height="wrap_content"
-                                       android:padding="10dp"/>
+                                       android:layout_height="@dimen/reading_list_row_height"
+                                       android:layout_gravity="center_vertical"/>
--- a/mobile/android/base/resources/layout/reading_list_row_view.xml
+++ b/mobile/android/base/resources/layout/reading_list_row_view.xml
@@ -1,34 +1,39 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
 
     <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal">
+        android:layout_width="0dip"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:paddingLeft="@dimen/reading_list_row_padding_left"
+        android:paddingRight="@dimen/reading_list_row_padding_right"
+        android:orientation="vertical"
+        android:gravity="center_vertical">
 
         <TextView
             android:id="@+id/title"
-            android:layout_width="0dip"
-            android:layout_height="match_parent"
-            android:layout_weight="1"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingBottom="4dp"
             style="@style/Widget.ReadingListRow.Title" />
 
         <TextView
-            android:id="@+id/read_time"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            style="@style/Widget.ReadingListRow.ReadTime" />
+            android:id="@+id/excerpt"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            style="@style/Widget.ReadingListRow.Description" />
 
     </LinearLayout>
 
     <TextView
-        android:id="@+id/excerpt"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        style="@style/Widget.ReadingListRow.Description" />
+        android:id="@+id/read_time"
+        android:layout_width="64dp"
+        android:layout_height="match_parent"
+        android:gravity="center"
+        style="@style/Widget.ReadingListRow.ReadTime" />
 
 </merge>
--- a/mobile/android/base/resources/values-large-v11/dimens.xml
+++ b/mobile/android/base/resources/values-large-v11/dimens.xml
@@ -6,9 +6,12 @@
 <resources>
 
     <dimen name="browser_toolbar_height">56dp</dimen>
     <dimen name="browser_toolbar_button_padding">16dp</dimen>
 
     <dimen name="tabs_counter_size">26sp</dimen>
     <dimen name="panel_grid_view_column_width">200dp</dimen>
 
+    <dimen name="reading_list_row_height">96dp</dimen>
+    <dimen name="reading_list_row_padding_right">15dp</dimen>
+
 </resources>
--- a/mobile/android/base/resources/values-large-v11/styles.xml
+++ b/mobile/android/base/resources/values-large-v11/styles.xml
@@ -127,16 +127,23 @@
         <item name="android:paddingTop">30dp</item>
         <item name="android:paddingLeft">32dp</item>
         <item name="android:paddingRight">32dp</item>
         <item name="topDivider">false</item>
     </style>
 
     <style name="Widget.ReadingListView" parent="Widget.BookmarksListView"/>
 
+    <style name="Widget.ReadingListRow.Description">
+        <item name="android:textAppearance">@style/TextAppearance.Widget.Home.ItemDescription</item>
+        <item name="android:maxLines">2</item>
+        <item name="android:ellipsize">end</item>
+        <item name="android:lineSpacingMultiplier">1.3</item>
+    </style>
+
     <style name="Widget.HomeBanner">
         <item name="android:paddingLeft">32dp</item>
         <item name="android:paddingRight">32dp</item>
     </style>
 
     <!-- Tabs panel -->
     <style name="TabsPanelFrame.RemoteTabs" parent="TabsPanelFrameBase">
         <item name="android:paddingLeft">112dp</item>
--- a/mobile/android/base/resources/values-v16/styles.xml
+++ b/mobile/android/base/resources/values-v16/styles.xml
@@ -12,22 +12,16 @@
     <style name="TextAppearance.Widget.Home.ItemTitle" parent="TextAppearance.Medium">
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
 
     <style name="TextAppearance.Widget.Home.PageTitle" parent="TextAppearance.Medium">
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
 
-    <style name="Widget.ReadingListRow.ReadTime">
-        <item name="android:textStyle">italic</item>
-        <item name="android:textColor">#FF9400</item>
-        <item name="android:fontFamily">sans-serif-condensed</item>
-    </style>
-
     <style name="OnboardStartTextAppearance.Subtext">
         <item name="android:textSize">18sp</item>
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
     <style name="TextAppearance.UrlBar.Title" parent="TextAppearance.Small">
         <item name="android:textSize">15sp</item>
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -56,19 +56,24 @@
     <dimen name="favicon_largest_interesting_size">32dp</dimen>
 
     <!-- Site security icon -->
     <!-- If one of these values changes, they all should. -->
     <dimen name="site_security_bottom_margin">.5dp</dimen>
     <dimen name="new_tablet_site_security_unknown_inset_top">1dp</dimen>
     <dimen name="new_tablet_site_security_unknown_inset_bottom">-1dp</dimen>
 
-    <!-- Page Row height -->
+    <!-- Regular page row on about:home -->
     <dimen name="page_row_height">64dp</dimen>
 
+    <!-- Reading list row on about:home -->
+    <dimen name="reading_list_row_height">128dp</dimen>
+    <dimen name="reading_list_row_padding_left">15dp</dimen>
+    <dimen name="reading_list_row_padding_right">10dp</dimen>
+
     <!-- Remote Tabs static view top padding. Less in landscape on phones. -->
     <dimen name="home_remote_tabs_top_padding">48dp</dimen>
 
     <!-- Remote Tabs Hidden devices row height -->
     <dimen name="home_remote_tabs_hidden_footer_height">48dp</dimen>
 
     <!-- Search Engine Row height -->
     <dimen name="search_row_height">48dp</dimen>
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -132,22 +132,22 @@
     <style name="Widget.ReadingListRow.Title">
         <item name="android:textAppearance">@style/TextAppearance.Widget.Home.ItemTitle</item>
         <item name="android:maxLines">2</item>
         <item name="android:ellipsize">end</item>
     </style>
 
     <style name="Widget.ReadingListRow.Description">
         <item name="android:textAppearance">@style/TextAppearance.Widget.Home.ItemDescription</item>
-        <item name="android:maxLines">4</item>
+        <item name="android:maxLines">3</item>
         <item name="android:ellipsize">end</item>
+        <item name="android:lineSpacingMultiplier">1.3</item>
     </style>
 
     <style name="Widget.ReadingListRow.ReadTime">
-        <item name="android:textStyle">italic</item>
         <item name="android:textColor">@color/text_color_highlight</item>
     </style>
 
     <style name="Widget.BookmarkFolderView" parent="Widget.TwoLinePageRow.Title">
         <item name="android:singleLine">true</item>
         <item name="android:ellipsize">none</item>
         <item name="android:paddingLeft">10dip</item>
         <item name="android:drawablePadding">10dip</item>
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -289,17 +289,17 @@
   <string name="edit_mode_cancel">&edit_mode_cancel;</string>
 
   <string name="site_settings_title">&site_settings_title3;</string>
   <string name="site_settings_cancel">&site_settings_cancel;</string>
   <string name="site_settings_clear">&site_settings_clear;</string>
   <string name="site_settings_no_settings">&site_settings_no_settings;</string>
 
   <string name="reading_list_added">&reading_list_added;</string>
-  <string name="reading_list_time_minutes">&reading_list_time_minutes;</string>
+  <string name="reading_list_time_minutes">&reading_list_time_minutes2;</string>
   <string name="reading_list_time_over_an_hour">&reading_list_time_over_an_hour;</string>
 
   <string name="page_action_dropmarker_description">&page_action_dropmarker_description;</string>
 
   <string name="contextmenu_open_new_tab">&contextmenu_open_new_tab;</string>
   <string name="contextmenu_open_private_tab">&contextmenu_open_private_tab;</string>
   <string name="contextmenu_remove">&contextmenu_remove;</string>
   <string name="contextmenu_add_to_launcher">&contextmenu_add_to_launcher;</string>