SHARE
TWEET

Untitled

a guest Jan 24th, 2020 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import android.view.View;
  2. import android.widget.TextView;
  3.  
  4. import androidx.annotation.NonNull;
  5. import androidx.recyclerview.widget.RecyclerView;
  6.  
  7. import com.easy.myapplication1236.R;
  8.  
  9. public class WithTitle extends RecyclerView.ViewHolder implements View.OnClickListener {
  10.  
  11.     private final TextView adapter_task_id;
  12.     private TestModel testModel;
  13.     private RecyclerViewAdapter.ItemClickListener itemClickListener;
  14.  
  15.     WithTitle(@NonNull View itemView, RecyclerViewAdapter.ItemClickListener itemClickListener) {
  16.         super(itemView);
  17.         adapter_task_id = itemView.findViewById(R.id.textView);
  18.  
  19.         this.itemClickListener = itemClickListener;
  20.  
  21.         itemView.setOnClickListener(this);
  22.     }
  23.  
  24.     public void bind(TestModel model) {
  25.         this.testModel = model;
  26.        
  27.         adapter_task_id.setText(String.valueOf(model.getId()));
  28.     }
  29.  
  30.     @Override
  31.     public void onClick(View v) {
  32.         itemClickListener.onItemClick(testModel.getId());
  33.     }
  34.  
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top