Merge pull request #790 from MrCustomizer/#784_firstEntryNotMarkedAsRead
#784: Fix first entry not marked as read after sync
This commit is contained in:
commit
27b52f3bed
1 changed files with 4 additions and 0 deletions
|
@ -281,6 +281,7 @@ public class NewsReaderDetailFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadRssItemsIntoView(List<RssItem> rssItems) {
|
void loadRssItemsIntoView(List<RssItem> rssItems) {
|
||||||
|
previousFirstVisibleItem = -1;
|
||||||
try {
|
try {
|
||||||
NewsListRecyclerAdapter nra = ((NewsListRecyclerAdapter) recyclerView.getAdapter());
|
NewsListRecyclerAdapter nra = ((NewsListRecyclerAdapter) recyclerView.getAdapter());
|
||||||
if (nra == null) {
|
if (nra == null) {
|
||||||
|
@ -537,6 +538,9 @@ public class NewsReaderDetailFragment extends Fragment {
|
||||||
loadRssItemsIntoView(rssItem);
|
loadRssItemsIntoView(rssItem);
|
||||||
|
|
||||||
if (rssItem.size() < 10) { // Less than 10 items in the list (usually 3-5 items fit on one screen)
|
if (rssItem.size() < 10) { // Less than 10 items in the list (usually 3-5 items fit on one screen)
|
||||||
|
// There is no API to check, if this listener has already been added. We don't want to
|
||||||
|
// add it multiple times, so we take the safe route here by removing it before adding it.
|
||||||
|
recyclerView.removeOnItemTouchListener(itemTouchListener);
|
||||||
recyclerView.addOnItemTouchListener(itemTouchListener);
|
recyclerView.addOnItemTouchListener(itemTouchListener);
|
||||||
} else {
|
} else {
|
||||||
recyclerView.removeOnItemTouchListener(itemTouchListener);
|
recyclerView.removeOnItemTouchListener(itemTouchListener);
|
||||||
|
|
Loading…
Reference in a new issue