@Override public void onChildDrawOver( Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { super.onChildDrawOver(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive); if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) { View itemView = viewHolder.itemView; c.save(); if (dX > 0) { c.clipRect( itemView.getLeft(), itemView.getTop(), itemView.getLeft() + dX, itemView.getBottom()); c.translate(itemView.getLeft(), itemView.getTop()); } else { c.clipRect( itemView.getRight() + dX, itemView.getTop(), itemView.getRight(), itemView.getBottom()); c.translate(itemView.getRight() + dX, itemView.getTop()); } mAdapter.onItemSwiping(c, viewHolder, dX, dY, isCurrentlyActive); c.restore(); } }
@Override public void onChildDrawOver( Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { super.onChildDrawOver(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive); }