use of com.mxt.anitrend.model.entity.base.RecommendationBase in project anitrend-app by AniTrend.
the class MediaRecommendationsFragment method onChanged.
@Override
public void onChanged(@Nullable ConnectionContainer<PageContainer<RecommendationBase>> content) {
if (content != null) {
if (!content.isEmpty()) {
if (content.getConnection().hasPageInfo())
getPresenter().setPageInfo(content.getConnection().getPageInfo());
ArrayList<RecyclerItem> entityMap = new ArrayList<>();
for (RecommendationBase recommendation : content.getConnection().getPageData()) {
if (recommendation.getMediaRecommendation() != null)
entityMap.add(recommendation.getMediaRecommendation());
}
onPostProcessed(entityMap);
}
} else
onPostProcessed(Collections.emptyList());
if (mAdapter.getItemCount() < 1)
onPostProcessed(null);
}
Aggregations