use of org.wordpress.android.ui.reader.adapters.ReaderPostAdapter in project WordPress-Android by wordpress-mobile.
the class ReaderPostListFragment method getPostAdapter.
private ReaderPostAdapter getPostAdapter() {
if (mPostAdapter == null) {
AppLog.d(T.READER, "reader post list > creating post adapter");
Context context = WPActivityUtils.getThemedContext(getActivity());
mPostAdapter = new ReaderPostAdapter(context, getPostListType());
mPostAdapter.setOnPostSelectedListener(this);
mPostAdapter.setOnPostPopupListener(this);
mPostAdapter.setOnDataLoadedListener(mDataLoadedListener);
mPostAdapter.setOnDataRequestedListener(mDataRequestedListener);
if (getActivity() instanceof ReaderSiteHeaderView.OnBlogInfoLoadedListener) {
mPostAdapter.setOnBlogInfoLoadedListener((ReaderSiteHeaderView.OnBlogInfoLoadedListener) getActivity());
}
if (getPostListType().isTagType()) {
mPostAdapter.setCurrentTag(getCurrentTag());
} else if (getPostListType() == ReaderPostListType.BLOG_PREVIEW) {
mPostAdapter.setCurrentBlogAndFeed(mCurrentBlogId, mCurrentFeedId);
} else if (getPostListType() == ReaderPostListType.SEARCH_RESULTS) {
ReaderTag searchTag = ReaderSearchService.getTagForSearchQuery(mCurrentSearchQuery);
mPostAdapter.setCurrentTag(searchTag);
}
}
return mPostAdapter;
}
Aggregations