use of com.kickstarter.models.Photo in project android-oss by kickstarter.
the class ProjectStateChangedViewHolder method onBind.
@Override
public void onBind() {
final Project project = activity().project();
if (project == null) {
return;
}
final User user = activity().user();
if (user == null) {
return;
}
final Photo photo = project.photo();
if (photo == null) {
return;
}
Picasso.with(context()).load(photo.little()).into(projectPhotoImageView);
switch(activity().category()) {
case Activity.CATEGORY_FAILURE:
titleTextView.setText(ksString.format(projectNotSuccessfullyFundedString, "project_name", project.name()));
break;
case Activity.CATEGORY_CANCELLATION:
titleTextView.setText(ksString.format(projectCanceledByCreatorString, "project_name", project.name()));
break;
case Activity.CATEGORY_SUSPENSION:
titleTextView.setText(ksString.format(projectSuspendedString, "project_name", project.name()));
break;
default:
titleTextView.setText("");
}
}
use of com.kickstarter.models.Photo in project android-oss by kickstarter.
the class ProjectUpdateViewHolder method onBind.
@Override
public void onBind() {
final Context context = context();
final Project project = activity().project();
if (project == null) {
return;
}
final User user = activity().user();
if (user == null) {
return;
}
final Photo photo = project.photo();
if (photo == null) {
return;
}
final Update update = activity().update();
if (update == null) {
return;
}
final DateTime publishedAt = ObjectUtils.coalesce(update.publishedAt(), new DateTime());
projectNameTextView.setText(project.name());
Picasso.with(context).load(photo.little()).into(projectPhotoImageView);
timestampTextView.setText(DateTimeUtils.relative(context, ksString, publishedAt));
updateBodyTextView.setText(update.truncatedBody());
updateSequenceTextView.setText(ksString.format(projectUpdateCountString, "update_count", String.valueOf(update.sequence())));
updateTitleTextView.setText(update.title());
}
Aggregations