From 3bafe83a065ff54090c99441703aff048c402d65 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Mon, 18 Jan 2016 18:37:30 -0500 Subject: [PATCH] Bug 1234335 - Remove shortcut to add an item to your reading list from long tapping on reader view icon. r=ahunt --HG-- extra : commitid : H46xjDcVqQJ extra : rebase_source : 808175c9606ba2921df33065164a5820ee8bbcbc --- .../mozilla/gecko/home/ReadingListPanel.java | 27 ------------- .../base/locales/en-US/android_strings.dtd | 8 ---- mobile/android/base/strings.xml.in | 2 - mobile/android/chrome/content/Reader.js | 38 +------------------ 4 files changed, 1 insertion(+), 74 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/home/ReadingListPanel.java b/mobile/android/base/java/org/mozilla/gecko/home/ReadingListPanel.java index b23b5f32532b..65bb552ef8ed 100644 --- a/mobile/android/base/java/org/mozilla/gecko/home/ReadingListPanel.java +++ b/mobile/android/base/java/org/mozilla/gecko/home/ReadingListPanel.java @@ -165,33 +165,6 @@ public class ReadingListPanel extends HomeFragment { final ImageView emptyImage = (ImageView) mEmptyView.findViewById(R.id.home_empty_image); emptyImage.setImageResource(R.drawable.icon_reading_list_empty); - final TextView emptyHint = (TextView) mEmptyView.findViewById(R.id.home_empty_hint); - if (HardwareUtils.isLowMemoryPlatform()) { - emptyHint.setVisibility(View.GONE); - } else { - String readingListHint = getString(R.string.home_reading_list_hint); - String readingListDesc = getString(R.string.home_reading_list_hint_accessible); - emptyHint.setText(readingListHint); - emptyHint.setContentDescription(readingListDesc); - - // Use an ImageSpan to include the reader icon in the "Tip". - int imageSpanIndex = readingListHint.indexOf(MATCH_STRING); - if (imageSpanIndex != -1) { - final ImageSpan readingListIcon = new ImageSpan(getActivity(), R.drawable.reader_cropped, ImageSpan.ALIGN_BOTTOM); - final SpannableStringBuilder hintBuilder = new SpannableStringBuilder(readingListHint); - - // Add additional spacing. - hintBuilder.insert(imageSpanIndex + MATCH_STRING.length(), " "); - hintBuilder.insert(imageSpanIndex, " "); - - // Add icon. - hintBuilder.setSpan(readingListIcon, imageSpanIndex + 1, imageSpanIndex + MATCH_STRING.length() + 1, Spanned.SPAN_INCLUSIVE_INCLUSIVE); - - emptyHint.setText(hintBuilder, TextView.BufferType.SPANNABLE); - } - emptyHint.setVisibility(View.VISIBLE); - } - mList.setEmptyView(mEmptyView); } } diff --git a/mobile/android/base/locales/en-US/android_strings.dtd b/mobile/android/base/locales/en-US/android_strings.dtd index 30201e176dbc..de04435d0998 100644 --- a/mobile/android/base/locales/en-US/android_strings.dtd +++ b/mobile/android/base/locales/en-US/android_strings.dtd @@ -537,14 +537,6 @@ size. --> The placeholders &formatS1; and &formatS2; are used to mark the location of text underlining. --> - - - - diff --git a/mobile/android/base/strings.xml.in b/mobile/android/base/strings.xml.in index a84dec7f4f5a..56548dd5937b 100644 --- a/mobile/android/base/strings.xml.in +++ b/mobile/android/base/strings.xml.in @@ -441,8 +441,6 @@ &home_selected_empty; &home_most_recent_emptyhint2; &home_reading_list_empty; - &home_reading_list_hint3; - &home_reading_list_hint_accessible2; &home_default_empty; &home_move_up_to_filter; &home_remote_tabs_title; diff --git a/mobile/android/chrome/content/Reader.js b/mobile/android/chrome/content/Reader.js index d90d56439965..a23256903997 100644 --- a/mobile/android/chrome/content/Reader.js +++ b/mobile/android/chrome/content/Reader.js @@ -32,8 +32,7 @@ var Reader = { HIDDEN: 0, SHOWN: 1, TAP_ENTER: 2, - TAP_EXIT: 3, - LONG_TAP: 4 + TAP_EXIT: 3 }, /** @@ -224,12 +223,6 @@ var Reader = { Reader._buttonHistogram.add(Reader._buttonHistogramValues.TAP_ENTER); } }, - - readerModeActiveCallback: function(tabID) { - Reader._addTabToReadingList(tabID).catch(e => Cu.reportError("Error adding tab to reading list: " + e)); - UITelemetry.addEvent("save.1", "pageaction", null, "reading_list"); - Reader._buttonHistogram.add(Reader._buttonHistogramValues.LONG_TAP); - }, }, updatePageAction: function(tab) { @@ -247,7 +240,6 @@ var Reader = { icon: icon, title: title, clickCallback: () => this.pageAction.readerModeCallback(browser), - longClickCallback: () => this.pageAction.readerModeActiveCallback(tab.id), important: true }); }; @@ -312,34 +304,6 @@ var Reader = { return article; }), - _addTabToReadingList: Task.async(function* (tabID) { - let tab = BrowserApp.getTabForId(tabID); - if (!tab) { - throw new Error("Can't add tab to reading list because no tab found for ID: " + tabID); - } - - let url = tab.browser.currentURI.spec; - let article = yield this._getArticle(url).catch(e => { - Cu.reportError("Error getting article for tab: " + e); - return null; - }); - if (!article) { - // If there was a problem getting the article, just store the - // URL and title from the tab. - article = { - url: url, - title: tab.browser.contentDocument.title, - length: 0, - excerpt: "", - status: this.STATUS_FETCH_FAILED_UNSUPPORTED_FORMAT, - }; - } else { - article.status = this.STATUS_FETCHED_ARTICLE; - } - - this._addArticleToReadingList(article); - }), - _addArticleToReadingList: function(article) { Messaging.sendRequestForResult({ type: "Reader:AddToList",