mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 23:30:46 +00:00
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
This commit is contained in:
parent
329f3d039e
commit
3bafe83a06
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -537,14 +537,6 @@ size. -->
|
||||
The placeholders &formatS1; and &formatS2; are used to mark the location of text underlining. -->
|
||||
<!ENTITY home_most_recent_emptyhint2 "Psst: using a &formatS1;New Private Tab&formatS2; won\'t save your history.">
|
||||
<!ENTITY home_reading_list_empty "Articles you save for later show up here.">
|
||||
<!-- Localization note (home_reading_list_hint3): The "TIP" string is synonymous to "hint", "clue", etc. This string is displayed
|
||||
as an advisory message on how to add content to the reading list when the reading list empty.
|
||||
The placeholder &formatI; will be replaced by a small image of the icon described, and can be moved to wherever
|
||||
it is applicable. -->
|
||||
<!ENTITY home_reading_list_hint3 "Tip: Save articles to your reading list by long pressing the &formatI; icon when it appears in the URL bar.">
|
||||
<!-- Localization note (home_reading_list_hint_accessible2): This string is used
|
||||
as alternate text for accessibility. It is not visible in the UI. -->
|
||||
<!ENTITY home_reading_list_hint_accessible2 "Tip: Save articles to your reading list by long pressing the reader mode button when it appears in the URL bar.">
|
||||
|
||||
<!-- Localization note (home_default_empty): This string is used as the default text when there
|
||||
is no data to show in an about:home panel that was created by an add-on. -->
|
||||
|
@ -441,8 +441,6 @@
|
||||
<string name="home_selected_empty">&home_selected_empty;</string>
|
||||
<string name="home_most_recent_emptyhint">&home_most_recent_emptyhint2;</string>
|
||||
<string name="home_reading_list_empty">&home_reading_list_empty;</string>
|
||||
<string name="home_reading_list_hint">&home_reading_list_hint3;</string>
|
||||
<string name="home_reading_list_hint_accessible">&home_reading_list_hint_accessible2;</string>
|
||||
<string name="home_default_empty">&home_default_empty;</string>
|
||||
<string name="home_move_up_to_filter">&home_move_up_to_filter;</string>
|
||||
<string name="home_remote_tabs_title">&home_remote_tabs_title;</string>
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user