Bug 1317631 - Only handle clicks for highlights r?sebastian
This avoids us trying to obtain an invalid cursor position, since
the cursor only maps to highlights items (and not the headers).
MozReview-Commit-ID: 1NtJuvDRa5r
--- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamRecyclerAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/StreamRecyclerAdapter.java
@@ -89,18 +89,18 @@ public class StreamRecyclerAdapter exten
((HighlightItem) holder).bind(highlightsCursor, tilesWidth, tilesHeight);
} else if (type == TopPanel.LAYOUT_ID) {
((TopPanel) holder).bind(topSitesCursor, tiles, tilesWidth, tilesHeight);
}
}
@Override
public void onItemClicked(RecyclerView recyclerView, int position, View v) {
- if (position < 1) {
- // The header contains top sites and has its own click handling.
+ if (getItemViewType(position) != HighlightItem.LAYOUT_ID) {
+ // Headers (containing topsites and/or the highlights title) do their own click handling as needed
return;
}
highlightsCursor.moveToPosition(
translatePositionToCursor(position));
final String url = highlightsCursor.getString(
highlightsCursor.getColumnIndexOrThrow(BrowserContract.Combined.URL));