Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private int[] button;
- private int[] Views;
- private int[] Likes;
- private int[] DisLikes;
- private int[] Subscribers;
- private String[] Way;
- private int[] but;
- public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
- private CardView cardView;
- public ViewHolder(CardView v) {
- super(v);
- cardView = v;
- }
- public VideosAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- CardView cv = (CardView) LayoutInflater.from(parent.getContext())
- .inflate(R.layout.card_view, parent, false);
- return new ViewHolder(cv);
- }
- public VideosAdapter(int[] Views, int[] Likes, int[] DisLikes, int[] Subscribers, String[] Way) {
- this.Views = Views;
- this.Likes = Likes;
- this.DisLikes = DisLikes;
- this.Subscribers = Subscribers;
- this.Way = Way;
- this.but = but;
- }
- public void onBindViewHolder(ViewHolder holder, int position) {
- CardView cardView = holder.cardView;
- TextView textViewa = (TextView) cardView.findViewById(R.id.textView5);
- textViewa.setText(Integer.toString(Views[position]));
- TextView textViewb = (TextView) cardView.findViewById(R.id.textView8);
- textViewb.setText(Integer.toString(Likes[position]));
- TextView textViewc = (TextView) cardView.findViewById(R.id.textView7);
- textViewc.setText(Integer.toString(DisLikes[position]));
- TextView textViewd = (TextView) cardView.findViewById(R.id.textView6);
- textViewd.setText(Integer.toString(Subscribers[position]));
- EditText Name = (EditText) cardView.findViewById(R.id.editText2);
- Way[position] = Name.getText().toString();
- Button butt = (Button) cardView.findViewById(R.id.button);
- ViewHolder.butt.setOnClickListener(this);
- }
- public int getItemCount() {
- return Views.length;
- }
- public void onClick(CardView view) {
- insertData();
- }
- public void insertData() {
- // hgagfsiaufius
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement