@Background protected void loadNewInBackground() { Article firstArticle = null; if (getCount() > 0) { firstArticle = getItem(0); } provider.loadNew(firstArticle); }
@Background protected void loadNextInBackground() { int count = getItemCount(); Article lastArticle = null; if (count > 0) { lastArticle = getItem(count - 1); } provider.loadNext(count, lastArticle); }
@AfterInject protected void init() { provider.setListener(this); }
public void setFilter(Filter filter) { provider.setFilter(filter); reset(); }
private boolean isInList(Article article) { return article.isCached() == provider.getFilter().getType().equals(ArticleType.Newest); }