Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java

Issue 29977565: Issue 7199 - Hide Recommended by Pocket from the new tab page (Closed)
Patch Set: Created Jan. 9, 2019, 8:35 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java
===================================================================
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/StreamRecyclerAdapter.java
@@ -195,31 +195,36 @@
if (type == RowItemType.HIGHLIGHT_ITEM.getViewType()) {
final Highlight highlight = (Highlight) recyclerViewModel.get(position);
((WebpageItemRow) holder).bind(highlight, position, tilesSize);
} else if (type == RowItemType.TOP_PANEL.getViewType()) {
((TopPanelRow) holder).bind(topSitesCursor, tilesSize);
} else if (type == RowItemType.TOP_STORIES_ITEM.getViewType()) {
final TopStory story = (TopStory) recyclerViewModel.get(position);
((WebpageItemRow) holder).bind(story, position, tilesSize);
+ // We always hide top stories by Pocket
+ // See https://issues.adblockplus.org/ticket/7199
+ setViewVisible(false, holder.itemView);
} else if (type == RowItemType.HIGHLIGHTS_TITLE.getViewType()
|| type == RowItemType.HIGHLIGHTS_EMPTY_STATE.getViewType()) {
final Context context = holder.itemView.getContext();
final SharedPreferences sharedPreferences = GeckoSharedPrefs.forProfile(context);
final boolean bookmarksEnabled = sharedPreferences.getBoolean(ActivityStreamPanel.PREF_BOOKMARKS_ENABLED,
context.getResources().getBoolean(R.bool.pref_activitystream_recentbookmarks_enabled_default));
final boolean visitedEnabled = sharedPreferences.getBoolean(ActivityStreamPanel.PREF_VISITED_ENABLED,
context.getResources().getBoolean(R.bool.pref_activitystream_visited_enabled_default));
setViewVisible(bookmarksEnabled || visitedEnabled, holder.itemView);
} else if (type == RowItemType.TOP_STORIES_TITLE.getViewType()) {
final Context context = holder.itemView.getContext();
final boolean pocketEnabled = ActivityStreamConfiguration.isPocketEnabledByLocale(context) &&
GeckoSharedPrefs.forProfile(context).getBoolean(ActivityStreamPanel.PREF_POCKET_ENABLED,
context.getResources().getBoolean(R.bool.pref_activitystream_pocket_enabled_default));
- setViewVisible(pocketEnabled, holder.itemView);
+ // We always hide top stories by Pocket
+ // See https://issues.adblockplus.org/ticket/7199
+ setViewVisible(false, holder.itemView);
}
}
/**
* This sets a child view of the adapter visible or hidden.
*
* This only applies to children whose height and width are WRAP_CONTENT and MATCH_PARENT
* respectively.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld