diff options
Diffstat (limited to 'org.fox.ttrss/src')
3 files changed, 7 insertions, 3 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java index 6c3f90da..f6ac6b30 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java @@ -175,7 +175,7 @@ public class ArticlePager extends Fragment { } if (m_article != null) { - if (m_article.id == 0 || m_articles.indexOf(m_article) == -1) { + if (m_article.id == 0 || !m_articles.containsId(m_article.id)) { if (m_articles.size() > 0) { m_article = m_articles.get(0); m_listener.onArticleSelected(m_article, false); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java index 379661c4..dafcbe66 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java @@ -279,6 +279,7 @@ public class DetailActivity extends OnlineActivity implements HeadlinesEventList Article article = hf.getActiveArticle(); if (article == null && hf.getAllArticles().size() > 0) { + article = hf.getAllArticles().get(0); hf.setActiveArticle(article); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index b69fe3be..52b9de48 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -598,8 +598,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, if (result != null) { m_refreshInProgress = false; - if (m_articles.indexOf(m_activeArticle) == -1) + if (m_activeArticle != null && !m_articles.containsId(m_activeArticle.id)) { m_activeArticle = null; + } if (m_firstIdChanged) { m_articles.add(new Article(ARTICLE_SPECIAL_TOP_CHANGED)); @@ -613,7 +614,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, // not sure why but listview sometimes gets positioned while ignoring the header so // top headline content becomes partially obscured by the toolbar on phones // (not reproducible on avd) - if (!fappend) m_list.smoothScrollToPosition(0); + if (!fappend) { + m_list.smoothScrollToPosition(0); + } } else { if (m_lastError == ApiError.LOGIN_FAILED) { |