Search in sources :

Example 1 with HeaderVH

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);
            }
        });
    }
}
Also used : Section(com.tevinjeffrey.rutgersct.rutgersapi.model.Course.Section) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) HeaderVH(com.tevinjeffrey.rutgersct.ui.utils.HeaderVH)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 Section (com.tevinjeffrey.rutgersct.rutgersapi.model.Course.Section)1 HeaderVH (com.tevinjeffrey.rutgersct.ui.utils.HeaderVH)1