We are implementing ItemTouchHelper in a RecyclerView, we are making a Override of onChildDraw when we swipe to the left in the RV, the problem is, if I have a RecyclerView with X size, and I try to dismiss the 2, 3, 4 or 5 elements, the only one that show the text is the first element in the List, but, if is an image it work pretty well
@Override
public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
if (viewHolder.getAdapterPosition() == -1)
return;
View itemView = viewHolder.itemView;
Paint paint = new Paint();
paint.setColor(Color.WHITE);
paint.setTextSize(40);
paint.setTextAlign(Paint.Align.CENTER);
String inbox = itemView.getContext().getResources().getString(R.string.sendinbox);
c.drawText(inbox, itemView.getRight() - 200, itemView.getHeight()/2, paint);
super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
}