<commit_before>package com.kickstarter.ui.viewholders;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Pair;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.kickstarter.R;
import com.kickstarter.models.Project;
import com.kickstarter.models.User;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

import static com.kickstarter.libs.utils.ObjectUtils.requireNonNull;

public final class EmptyCommentFeedViewHolder extends KSViewHolder {
  Project project;
  User user;
  private final Delegate delegate;
  protected @Bind(R.id.comment_feed_login_button) Button commentFeedLoginButton;
  protected @Bind(R.id.no_comments_message) TextView noCommentsMessageTextView;

  public interface Delegate {
    void emptyCommentFeedLoginClicked(EmptyCommentFeedViewHolder viewHolder);
  }

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

  @Override
  public void bindData(final @Nullable Object data) throws Exception {
    @SuppressWarnings("unchecked")
    final Pair<Project, User> projectAndUser = requireNonNull((Pair<Project, User>) data);
    project = requireNonNull(projectAndUser.first, Project.class);
    user = requireNonNull(projectAndUser.second, User.class);
  }

  public void onBind() {
    if (user == null) {
      commentFeedLoginButton.setVisibility(View.VISIBLE);
      noCommentsMessageTextView.setText(R.string.project_comments_empty_state_logged_out_message_log_in);
    } else if (project.isBacking()) {
      commentFeedLoginButton.setVisibility(View.GONE);
      noCommentsMessageTextView.setText(R.string.project_comments_empty_state_backer_message);
    } else {
      commentFeedLoginButton.setVisibility(View.GONE);
      noCommentsMessageTextView.setText(R.string.update_comments_empty_state_non_backer_message);
    }<commit_msg>User does not need to be non-null since we allow logged out.<commit_after>package com.kickstarter.ui.viewholders;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Pair;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.kickstarter.R;
import com.kickstarter.models.Project;
import com.kickstarter.models.User;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

import static com.kickstarter.libs.utils.ObjectUtils.requireNonNull;

public final class EmptyCommentFeedViewHolder extends KSViewHolder {
  Project project;
  User user;
  private final Delegate delegate;
  protected @Bind(R.id.comment_feed_login_button) Button commentFeedLoginButton;
  protected @Bind(R.id.no_comments_message) TextView noCommentsMessageTextView;

  public interface Delegate {
    void emptyCommentFeedLoginClicked(EmptyCommentFeedViewHolder viewHolder);
  }

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

  @Override
  public void bindData(final @Nullable Object data) throws Exception {
    @SuppressWarnings("unchecked")
    final Pair<Project, User> projectAndUser = requireNonNull((Pair<Project, User>) data);
    project = requireNonNull(projectAndUser.first, Project.class);
    user = projectAndUser.second;
  }

  public void onBind() {
    if (user == null) {
      commentFeedLoginButton.setVisibility(View.VISIBLE);
      noCommentsMessageTextView.setText(R.string.project_comments_empty_state_logged_out_message_log_in);
    } else if (project.isBacking()) {
      commentFeedLoginButton.setVisibility(View.GONE);
      noCommentsMessageTextView.setText(R.string.project_comments_empty_state_backer_message);
    } else {
      commentFeedLoginButton.setVisibility(View.GONE);
      noCommentsMessageTextView.setText(R.string.update_comments_empty_state_non_backer_message);
    }
{'fraction_non_alphanumeric': 0.08595848595848596, 'fraction_numerical': 0.0, 'mean_word_length': 5.564102564102564, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6746922', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1164, 'n_words': 230}