As in the RecyclerAdapter set the element on the 3rd position color.
1 answer
The sequence number can be obtained from position in onBindViewHolder . Color can be set through the background of the root cell markup element. Like that:
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (position == 2) { holder.itemView.setBackgroundColor(Color.GREEN); } } |