SHARE
TWEET

Untitled

a guest Jun 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /p>
  2.  
  3. public class ChatRecyclerAdapter extends RecyclerView.Adapter {
  4.  
  5. private ArrayList Data = new ArrayList();
  6. private ArrayList MeData = new ArrayList();
  7.  
  8. @NonNull
  9.    @Override
  10.     public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
  11.  ...
  12. }
  13.  public int getItemViewType(int position) {
  14.  
  15.     //return position % 2 * 2;
  16.     return 0;
  17. }
  18.  
  19.  
  20.  
  21.  
  22. class ViewHolder2 extends RecyclerView.ViewHolder {
  23.  
  24.     private TextView textView1;
  25.  
  26.  
  27.     ViewHolder2(View itemView) {
  28.       ...
  29.     }
  30.  
  31.     void onBind(MeData data) {
  32.         textView1.setText(data.getTitle());
  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