use of net.osmand.plus.wikivoyage.explore.travelcards.ArticleTravelCard.ArticleTravelVH in project Osmand by osmandapp.
the class ExploreRvAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
BaseTravelCard item = getItem(position);
if (viewHolder instanceof HeaderTravelVH && item instanceof HeaderTravelCard) {
HeaderTravelCard headerTravelCard = (HeaderTravelCard) item;
headerTravelCard.setArticleItemCount(getArticleItemCount());
headerTravelCard.bindViewHolder(viewHolder);
} else if (viewHolder instanceof ArticleTravelVH && item instanceof TravelGpxCard) {
TravelGpxCard travelGpxCard = (TravelGpxCard) item;
travelGpxCard.setLastItem(position == getLastArticleItemIndex());
travelGpxCard.bindViewHolder(viewHolder);
} else if (viewHolder instanceof ArticleTravelVH && item instanceof ArticleTravelCard) {
ArticleTravelCard articleTravelCard = (ArticleTravelCard) item;
articleTravelCard.setLastItem(position == getLastArticleItemIndex());
articleTravelCard.bindViewHolder(viewHolder);
} else {
item.bindViewHolder(viewHolder);
}
}
Aggregations