package com.kickstarter.ui.viewholders;

import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.kickstarter.R;
import com.kickstarter.models.Project;
import com.squareup.picasso.Picasso;

import butterknife.Bind;
import butterknife.ButterKnife;

public final class ProjectContextViewHolder extends KSViewHolder {
  private Project project;
  private final Delegate delegate;

  public @Bind(R.id.context_photo) ImageView projectContextImageView;
  public @Bind(R.id.project_name) TextView projectNameTextView;
  public @Bind(R.id.creator_name) TextView creatorNameTextView;

  public interface Delegate {
    void projectContextClicked(ProjectContextViewHolder viewHolder);
  }

  public ProjectContextViewHolder(@NonNull final View view, @NonNull final Delegate delegate) {
    super(view);
    this.delegate = delegate;
    ButterKnife.bind(this, view);
  }

  public void onBind(@NonNull final Object datum) {
    this.project = (Project) datum;

    Picasso.with(view.getContext()).load(project.photo().full()).into(projectContextImageView);
    projectNameTextView.setText(project.name());
    creatorNameTextView.setText(project.creator().name());
  }

  @Override
  public void onClick(@NonNull final View view) {
    delegate.projectContextClicked(this);
  }
}

package com.kickstarter.ui.viewholders;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.kickstarter.KSApplication;
import com.kickstarter.R;
import com.kickstarter.libs.KSString;
import com.kickstarter.models.Project;
import com.squareup.picasso.Picasso;

import javax.inject.Inject;

import butterknife.Bind;
import butterknife.BindString;
import butterknife.ButterKnife;

public final class ProjectContextViewHolder extends KSViewHolder {
  private Project project;
  private Context context;
  private final Delegate delegate;

  protected @Bind(R.id.context_photo) ImageView projectContextImageView;
  protected @Bind(R.id.project_name) TextView projectNameTextView;
  protected @Bind(R.id.creator_name) TextView creatorNameTextView;
  protected @BindString(R.string.project_creator_by_creator) String projectCreatorByCreatorString;

  protected @Inject KSString ksString;

  public interface Delegate {
    void projectContextClicked(ProjectContextViewHolder viewHolder);
  }

  public ProjectContextViewHolder(final @NonNull View view, final @NonNull Delegate delegate) {
    super(view);
    this.delegate = delegate;
    this.context = view.getContext();
    ButterKnife.bind(this, view);
    ((KSApplication) context.getApplicationContext()).component().inject(this);
  }

  public void onBind(final @NonNull Object datum) {
    this.project = (Project) datum;

    Picasso.with(context).load(project.photo().full()).into(projectContextImageView);
    projectNameTextView.setText(project.name());
    creatorNameTextView.setText(ksString.format(
      projectCreatorByCreatorString,
      "creator_name",
      project.creator().name()
    ));
  }

  @Override
  public void onClick(final @NonNull View view) {
    delegate.projectContextClicked(this);
  }
}

fix creator name string in ProjectContextViewHolder