@Override
    public int getMovementFlags(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
        if (viewHolder instanceof RemovableViewHolder) {
            final RemovableViewHolder vHolder = ((RemovableViewHolder) viewHolder);
            if (!(vHolder).isRemovable())
                return 0;
            int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
            return makeMovementFlags(0, swipeFlags);
        } else
            return 0;
    }
This callback works with {@link RemovableViewHolder}. Only view holders that inherit from this class may be removed.
app/src/main/java/no/nordicsemi/android/nrfmesh/widgets/RemovableItemTouchHelperCallback.java