use of com.tevinjeffrey.rutgersct.ui.utils.HeaderVH in project Rutgers-Course-Tracker by tevjef.
the class CourseInfoFragmentAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
if (holder.getItemViewType() == TYPE_HEADER && position == 0) {
HeaderVH headerVH = (HeaderVH) holder;
headerVH.setHeaders(mHeaders);
} else if (holder.getItemViewType() == TYPE_ITEM) {
CourseInfoVH courseInfoVH = (CourseInfoVH) holder;
final Section section = sectionList.get(position - 1);
courseInfoVH.setOpenStatus(section);
courseInfoVH.setSectionNumber(section);
courseInfoVH.setInstructors(section);
courseInfoVH.setTimes(section);
courseInfoVH.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
itemClickListener.onItemClicked(section, v);
}
});
}
}
Aggregations