Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
- View view;
- TextView title,phone;
- LinearLayout contact_select_layout;
- ViewHolder(@NonNull View itemView) {
- super(itemView);
- view = itemView;
- title= itemView.findViewById(R.id.contact_name);
- phone= itemView.findViewById(R.id.contact_phone);
- contact_select_layout=itemView.findViewById(R.id.contact_select_layout);
- }
- @Override
- public void onClick(View v) {
- list.setSelected(!list.isSelected());
- v.setBackgroundColor(
- list.isSelected()? Color.parseColor("#FF5722"):
- Color.parseColor("#070707"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement