Bug 1234316 - Post: remove unused ReadingListRow and related styles r=liuche draft
authorAndrzej Hunt <ahunt@mozilla.com>
Thu, 17 Mar 2016 14:37:31 -0700
changeset 343980 35fb1778a369e1017ad308dcfd8714659b897075
parent 343979 b5d554e55253c91ada8b0118d59e3bf4af8466ce
child 343981 fb19f81c0700ccc86f8e807bc52e63e08c98713a
push id13730
push userahunt@mozilla.com
push dateWed, 23 Mar 2016 17:30:25 +0000
reviewersliuche
bugs1234316
milestone48.0a1
Bug 1234316 - Post: remove unused ReadingListRow and related styles r=liuche MozReview-Commit-ID: DVqsyMDEoBq
mobile/android/base/java/org/mozilla/gecko/home/ReadingListRow.java
mobile/android/base/moz.build
mobile/android/base/resources/layout/reading_list_item_row.xml
mobile/android/base/resources/values-large-v11/dimens.xml
mobile/android/base/resources/values-large-v11/styles.xml
mobile/android/base/resources/values/dimens.xml
mobile/android/base/resources/values/styles.xml
deleted file mode 100644
--- a/mobile/android/base/java/org/mozilla/gecko/home/ReadingListRow.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * 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/. */
-
-package org.mozilla.gecko.home;
-
-import org.mozilla.gecko.R;
-import org.mozilla.gecko.db.BrowserContract.ReadingListItems;
-import org.mozilla.gecko.util.StringUtils;
-
-import android.content.Context;
-import android.database.Cursor;
-import android.text.TextUtils;
-import android.util.AttributeSet;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-public class ReadingListRow extends LinearLayout {
-    private TextView title;
-    private TextView excerpt;
-    private ImageView indicator;
-
-    public ReadingListRow(Context context) {
-        this(context, null);
-    }
-
-    public ReadingListRow(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    @Override
-    protected void onFinishInflate() {
-        super.onFinishInflate();
-        title = (TextView) findViewById(R.id.title);
-        excerpt = (TextView) findViewById(R.id.excerpt);
-        indicator = (ImageView) findViewById(R.id.indicator);
-    }
-
-    public void updateFromCursor(Cursor cursor) {
-        if (cursor == null) {
-            return;
-        }
-
-        final boolean isUnread = cursor.getInt(cursor.getColumnIndexOrThrow(ReadingListItems.IS_UNREAD)) == 1;
-
-        final String url = cursor.getString(cursor.getColumnIndexOrThrow(ReadingListItems.URL));
-
-        final String titleText = cursor.getString(cursor.getColumnIndexOrThrow(ReadingListItems.TITLE));
-        title.setText(TextUtils.isEmpty(titleText) ? StringUtils.stripCommonSubdomains(StringUtils.stripScheme(url)) : titleText);
-        title.setTextAppearance(getContext(), isUnread ? R.style.Widget_ReadingListRow_Title_Unread : R.style.Widget_ReadingListRow_Title_Read);
-
-        final String excerptText = cursor.getString(cursor.getColumnIndexOrThrow(ReadingListItems.EXCERPT));
-        excerpt.setText(TextUtils.isEmpty(excerptText) ? url : excerptText);
-        excerpt.setTextAppearance(getContext(), isUnread ? R.style.Widget_ReadingListRow_Title_Unread : R.style.Widget_ReadingListRow_Title_Read);
-
-        indicator.setImageResource(isUnread ? R.drawable.reading_list_indicator_unread : R.drawable.reading_list_indicator_read);
-    }
-
-}
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -399,17 +399,16 @@ gbjar.sources += ['java/org/mozilla/geck
     'home/PanelListView.java',
     'home/PanelRecyclerView.java',
     'home/PanelRecyclerViewAdapter.java',
     'home/PanelRefreshLayout.java',
     'home/PanelViewAdapter.java',
     'home/PanelViewItemHandler.java',
     'home/PinSiteDialog.java',
     'home/ReadingListPanel.java',
-    'home/ReadingListRow.java',
     'home/RecentTabsPanel.java',
     'home/RemoteTabsBaseFragment.java',
     'home/RemoteTabsExpandableListFragment.java',
     'home/RemoteTabsExpandableListState.java',
     'home/RemoteTabsPanel.java',
     'home/RemoteTabsSplitPlaneFragment.java',
     'home/RemoteTabsStaticFragment.java',
     'home/SearchEngine.java',
deleted file mode 100644
--- a/mobile/android/base/resources/layout/reading_list_item_row.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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"
-                                       android:layout_width="match_parent"
-                                       android:layout_height="@dimen/reading_list_row_height"
-                                       android:layout_gravity="center_vertical">
-
-    <ImageView android:id="@+id/indicator"
-               android:layout_width="64dp"
-               android:layout_height="match_parent"
-               android:scaleType="center" />
-
-    <LinearLayout android:layout_width="0dip"
-                  android:layout_height="match_parent"
-                  android:layout_weight="1"
-                  android:paddingRight="@dimen/reading_list_row_padding_right"
-                  android:orientation="vertical"
-                  android:gravity="center_vertical">
-
-        <TextView android:id="@+id/title"
-                  android:layout_width="match_parent"
-                  android:layout_height="wrap_content"
-                  android:paddingBottom="4dp"
-                  style="@style/Widget.ReadingListRow.Title" />
-
-        <TextView android:id="@+id/excerpt"
-                  android:layout_width="match_parent"
-                  android:layout_height="wrap_content"
-                  style="@style/Widget.ReadingListRow.Description" />
-
-    </LinearLayout>
-
-</org.mozilla.gecko.home.ReadingListRow>
--- a/mobile/android/base/resources/values-large-v11/dimens.xml
+++ b/mobile/android/base/resources/values-large-v11/dimens.xml
@@ -26,16 +26,13 @@
 
     <dimen name="firstrun_brand_size">72dp</dimen>
     <dimen name="firstrun_background_height">300dp</dimen>
 
     <dimen name="tabs_panel_indicator_width">72dp</dimen>
     <dimen name="tabs_panel_button_width">60dp</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>
-
     <dimen name="overlay_prompt_container_width">360dp</dimen>
 
     <item name="tab_strip_content_start" type="dimen">72dp</item>
 
 </resources>
--- a/mobile/android/base/resources/values-large-v11/styles.xml
+++ b/mobile/android/base/resources/values-large-v11/styles.xml
@@ -72,25 +72,16 @@
     <style name="Widget.TopSitesListView" parent="Widget.BookmarksListView">
         <item name="android:paddingTop">30dp</item>
         <item name="android:paddingLeft">32dp</item>
         <item name="android:paddingRight">32dp</item>
         <item name="android:clipToPadding">false</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>
 
     <style name="TextAppearance.UrlBar.Title" parent="TextAppearance.Medium">
         <item name="android:textSize">16sp</item>
     </style>
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -83,20 +83,16 @@
 
     <!-- Regular page row on about:home -->
     <dimen name="page_row_height">64dp</dimen>
 
     <!-- Group/heading page row on about:home -->
     <dimen name="page_group_height">56dp</dimen>
     <dimen name="home_header_item_height">56dp</dimen>
 
-    <!-- Reading list row on about:home -->
-    <dimen name="reading_list_row_height">128dp</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">40dp</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
@@ -123,51 +123,16 @@
     </style>
 
     <style name="Widget.TwoLinePageRow.Url">
         <item name="android:textAppearance">@style/TextAppearance.Widget.Home.ItemDescription</item>
         <item name="android:includeFontPadding">false</item>
         <item name="android:singleLine">true</item>
     </style>
 
-    <style name="Widget.ReadingListRow" />
-
-    <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.Title.Read" parent="Widget.ReadingListRow.Title">
-        <item name="android:textColor">@color/disabled_grey</item>
-    </style>
-
-    <style name="Widget.ReadingListRow.Title.Unread" parent="Widget.ReadingListRow.Title">
-        <item name="android:textColor">@color/text_and_tabs_tray_grey</item>
-    </style>
-
-    <style name="Widget.ReadingListRow.Description">
-        <item name="android:textAppearance">@style/TextAppearance.Widget.Home.ItemDescription</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.Description.Read" parent="Widget.ReadingListRow.Description">
-        <item name="android:textColor">@color/disabled_grey</item>
-    </style>
-
-    <style name="Widget.ReadingListRow.Description.Unread" parent="Widget.ReadingListRow.Description">
-        <item name="android:textColor">@color/text_and_tabs_tray_grey</item>
-    </style>
-
-    <style name="Widget.ReadingListRow.ReadTime">
-        <item name="android:textColor">@color/fennec_ui_orange</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:background">@color/about_page_header_grey</item>
         <item name="android:paddingLeft">20dp</item>
         <item name="android:drawablePadding">20dp</item>
         <item name="android:drawableLeft">@drawable/bookmark_folder</item>
     </style>
@@ -238,18 +203,16 @@
     </style>
 
     <style name="Widget.HomeListView" parent="Widget.ListView">
         <item name="android:divider">@color/toolbar_divider_grey</item>
     </style>
 
     <style name="Widget.TopSitesListView" parent="Widget.BookmarksListView"/>
 
-    <style name="Widget.ReadingListView" parent="Widget.BookmarksListView"/>
-
     <style name="Widget.HomeBanner"/>
 
     <style name="Widget.Home" />
 
     <style name="Widget.Home.HeaderItem">
         <item name="android:layout_width">match_parent</item>
         <item name="android:layout_height">32dp</item>
         <item name="android:textAppearance">@style/TextAppearance.Widget.Home.Header</item>