use of com.byoutline.kickmaterial.utils.AplaTransformation in project kickmaterial by byoutline.
the class ProjectsAdapter method onBindViewHolder.
// Replace the contents of a view. This is invoked by the layout manager.
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
int type = getItemViewType(position);
switch(type) {
case NORMAL_ITEM:
case BIG_ITEM:
Project project = getItem(position);
if (project != null) {
if (holder.projectId == project.id) {
// This view holder appears to already show correct project.
return;
} else {
holder.projectId = project.id;
}
ViewUtils.setTextForViewOrHideIt(holder.projectItemBigTitleTv, project.getProjectName());
holder.projectItemBigProgressSb.setProgress((int) project.getPercentProgress());
Picasso picasso = Picasso.with(context);
final RequestCreator picassoBuilder;
if (type == BIG_ITEM) {
setProjectDetailsInfo(null, holder.projectItemBigDescTv, holder.projectItemBigGatheredMoneyTv, holder.projectItemBigPledgedOfTv, holder.projectItemBigBackersTv, holder.projectItemBigTimeLeft, holder.projectItemBigTimeLeftType, project);
picassoBuilder = picasso.load(project.getBigPhotoUrl()).resize(bigItemWidth, bigItemHeight).placeholder(R.drawable.blank_project_wide);
} else {
picassoBuilder = picasso.load(project.getPhotoUrl()).resize(smallItemWidth, smallItemHeight).placeholder(R.drawable.blank_project_small);
}
picassoBuilder.onlyScaleDown().transform(new AplaTransformation()).centerCrop().into(holder.projectItemBigPhotoIv);
}
break;
}
}
Aggregations