Question: I want to use the new ItemTouchHelper from the v7 design library. I use it inside of a SwipeRefreshLayout.

The problem is that with the SwipeRefreshLayout the animation for the swipe to dismiss is wrong and buggy.

Anyone knows how to fix this?

Answer: 
You could disable your SwipeRefreshLayout as long as you are swiping.

```
final ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.Callback() {
    @Override
    public int getMovementFlags(RecyclerView recyclerView, ViewHolder viewHolder) {
        return makeMovementFlags(0, ItemTouchHelper.START | ItemTouchHelper.END);
    }

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

    @Override
    public void onSwiped(ViewHolder viewHolder, int direction) {
        // do something
    }

    @Override
    public void onSelectedChanged(ViewHolder viewHolder, int actionState) {
        super.onSelectedChanged(viewHolder, actionState);
        final boolean swiping = actionState == ItemTouchHelper.ACTION_STATE_SWIPE;
        swipeRefreshLayout.setEnabled(!swiping);
    }
});
itemTouchHelper.attachToRecyclerView(recyclerView);

```
**one of many:**

```
 /**
 * Notify the widget that refresh state has changed. 
 * method to avoid bug in setRefreshing(boolean)     
 * Do not call this when refresh is triggered by a swipe gesture.
 * @param swipeRefreshLayout - layout, take care not to pass null parameter
 * @param isRefreshing - whether or not the view should show refresh progress.
 *               
 */
public static void setRefreshing(final SwipeRefreshLayout swipeRefreshLayout, final boolean isRefreshing) {
    swipeRefreshLayout.post(new Runnable() {
        @Override
        public void run() {
            swipeRefreshLayout.setRefreshing(isRefreshing);
        }
    });
}

```

**some other possibilities:**

> 
> [posted bug with some workarounds](https://code.google.com/p/android/issues/detail?id=181873)
> 
> 
>