Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. private int[] button;
  2. private int[] Views;
  3. private int[] Likes;
  4. private int[] DisLikes;
  5. private int[] Subscribers;
  6. private String[] Way;
  7. private int[] but;
  8.  
  9. public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
  10. private CardView cardView;
  11.  
  12. public ViewHolder(CardView v) {
  13. super(v);
  14. cardView = v;
  15.  
  16. }
  17.  
  18. public VideosAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  19. CardView cv = (CardView) LayoutInflater.from(parent.getContext())
  20. .inflate(R.layout.card_view, parent, false);
  21. return new ViewHolder(cv);
  22. }
  23.  
  24.  
  25. public VideosAdapter(int[] Views, int[] Likes, int[] DisLikes, int[] Subscribers, String[] Way) {
  26. this.Views = Views;
  27. this.Likes = Likes;
  28. this.DisLikes = DisLikes;
  29. this.Subscribers = Subscribers;
  30. this.Way = Way;
  31. this.but = but;
  32.  
  33. }
  34.  
  35. public void onBindViewHolder(ViewHolder holder, int position) {
  36.  
  37. CardView cardView = holder.cardView;
  38. TextView textViewa = (TextView) cardView.findViewById(R.id.textView5);
  39. textViewa.setText(Integer.toString(Views[position]));
  40. TextView textViewb = (TextView) cardView.findViewById(R.id.textView8);
  41. textViewb.setText(Integer.toString(Likes[position]));
  42. TextView textViewc = (TextView) cardView.findViewById(R.id.textView7);
  43. textViewc.setText(Integer.toString(DisLikes[position]));
  44. TextView textViewd = (TextView) cardView.findViewById(R.id.textView6);
  45. textViewd.setText(Integer.toString(Subscribers[position]));
  46. EditText Name = (EditText) cardView.findViewById(R.id.editText2);
  47. Way[position] = Name.getText().toString();
  48.  
  49. Button butt = (Button) cardView.findViewById(R.id.button);
  50. ViewHolder.butt.setOnClickListener(this);
  51.  
  52. }
  53.  
  54. public int getItemCount() {
  55.  
  56. return Views.length;
  57. }
  58.  
  59. public void onClick(CardView view) {
  60.  
  61. insertData();
  62. }
  63.  
  64. public void insertData() {
  65. // hgagfsiaufius
  66.  
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement