I added a custom `ItemTouchHelper.SimpleCallback` class to my `RecyclerView` to add the feature "Dismiss on swipe" where a user can swipe an item to the left and item gets deleted from the list.

I limited the amount the view can get "swiped" to left to 10% of view length, by dividing the dX (from onChildDraw()) by 10. However, the amount of lenght the user have to swipe is 100% of the screen for the item to get swiped by 10%. I want to limit the swiping (increase item swipe speed?) so that the user only have to swipe 10% of the screen to get the item to swipe 10%. See photo below: 

[![enter image description here](https://i.stack.imgur.com/4RFlX.png)](https://i.stack.imgur.com/4RFlX.png)

The purple circle is user touch. As user swiped all screen width, the item swipes 10% (The red is the layout that shows "behind" item when swiping).

How can I increase wipe speed to swiping 10% of screen width is enough, isteading of swiping whole screen width?

Here is the code for my ItemTouchHelper.SimpleCallback class:

```
public class SwipeDeleteHelper extends ItemTouchHelper.SimpleCallback {

    private GameAdapter adapter;
    private Drawable icon;
    private final ColorDrawable background;
    private static final int LIMIT_SWIPE_LENGTH = 10;

    public SwipeDeleteHelper(GameAdapter adapter, Context context) {
        super(0, ItemTouchHelper.LEFT);
        this.adapter = adapter;
        icon = ContextCompat.getDrawable(adapter.getContext(),
                R.drawable.delete);
        background = new ColorDrawable(context.getColor(R.color.colorAccent));
    }

    @Override
    public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
        return false;
    }

    @Override
    public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {
        int position = viewHolder.getAdapterPosition();
        adapter.deleteItem(position);
    }

    @Override
    public void onChildDraw(@NotNull Canvas c, @NotNull RecyclerView recyclerView, @NotNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
        dX = dX/LIMIT_SWIPE_LENGTH;

        super.onChildDraw(c, recyclerView, viewHolder, dX,
                dY, actionState, isCurrentlyActive);

        View itemView = viewHolder.itemView;
        int backgroundCornerOffset = 20;

        int iconMargin = (itemView.getHeight() - icon.getIntrinsicHeight()) / 2;
        int iconTop = itemView.getTop() + (itemView.getHeight() - icon.getIntrinsicHeight()) / 2;
        int iconBottom = iconTop + icon.getIntrinsicHeight();

        if(dX < 0) { //left swipe
            int iconLeft = itemView.getRight() - iconMargin - icon.getIntrinsicWidth();
            int iconRight = itemView.getRight() - iconMargin;
            icon.setBounds(iconLeft, iconTop, iconRight, iconBottom);

            background.setBounds(itemView.getRight() + ((int) dX) - backgroundCornerOffset,
                    itemView.getTop(), itemView.getRight(), itemView.getBottom());
        } else { //unswiped
            background.setBounds(0, 0, 0, 0);
        }
        background.draw(c);
        icon.draw(c);
    }

}

```