Search in sources :

Example 1 with ReviewsViewHolder

use of com.fastaccess.ui.adapter.viewholder.ReviewsViewHolder in project FastHub by k0shk0sh.

the class IssuesTimelineAdapter method onBindView.

@Override
protected void onBindView(BaseViewHolder holder, int position) {
    TimelineModel model = getItem(position);
    if (model.getType() == TimelineModel.HEADER) {
        ((IssueDetailsViewHolder) holder).bind(model);
    } else if (model.getType() == TimelineModel.EVENT) {
        ((IssueTimelineViewHolder) holder).bind(model);
    } else if (model.getType() == TimelineModel.COMMENT) {
        ((TimelineCommentsViewHolder) holder).bind(model);
    } else if (model.getType() == TimelineModel.GROUP) {
        ((GroupedReviewsViewHolder) holder).bind(model);
    } else if (model.getType() == TimelineModel.REVIEW) {
        ((ReviewsViewHolder) holder).bind(model);
    } else if (model.getType() == TimelineModel.COMMIT_COMMENTS) {
        ((CommitThreadViewHolder) holder).bind(model);
    } else if (model.getType() == TimelineModel.STATUS && model.getStatus() != null) {
        ((PullStatusViewHolder) holder).bind(model.getStatus());
    }
    if (model.getType() != TimelineModel.COMMENT) {
        StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) holder.itemView.getLayoutParams();
        layoutParams.setFullSpan(true);
    }
}
Also used : IssueDetailsViewHolder(com.fastaccess.ui.adapter.viewholder.IssueDetailsViewHolder) PullStatusViewHolder(com.fastaccess.ui.adapter.viewholder.PullStatusViewHolder) TimelineCommentsViewHolder(com.fastaccess.ui.adapter.viewholder.TimelineCommentsViewHolder) StaggeredGridLayoutManager(android.support.v7.widget.StaggeredGridLayoutManager) ReviewsViewHolder(com.fastaccess.ui.adapter.viewholder.ReviewsViewHolder) GroupedReviewsViewHolder(com.fastaccess.ui.adapter.viewholder.GroupedReviewsViewHolder) TimelineModel(com.fastaccess.data.dao.TimelineModel)

Aggregations

StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)1 TimelineModel (com.fastaccess.data.dao.TimelineModel)1 GroupedReviewsViewHolder (com.fastaccess.ui.adapter.viewholder.GroupedReviewsViewHolder)1 IssueDetailsViewHolder (com.fastaccess.ui.adapter.viewholder.IssueDetailsViewHolder)1 PullStatusViewHolder (com.fastaccess.ui.adapter.viewholder.PullStatusViewHolder)1 ReviewsViewHolder (com.fastaccess.ui.adapter.viewholder.ReviewsViewHolder)1 TimelineCommentsViewHolder (com.fastaccess.ui.adapter.viewholder.TimelineCommentsViewHolder)1