title: How to use ItemTouchHelper properly
body: <p>I'm trying to use a <code>RecyclerView</code> with <code>ItemTouchHelper</code> for basic “drag &amp; drop” and “swipe-to-dismiss” implementation. 
  Swipe works correctly, items are deleted in adapter correctly, animation is correct, but “drag &amp; drop” behaviour is very strange. After long click view isn't moving, however swapping items in adapter are correct.</p>
  
  <p><a href="https://i.stack.imgur.com/xJZa0.gif" rel="nofollow noreferrer">this is how it works in my RecyclerView</a></p>
  
  <p><a href="https://i.stack.imgur.com/uPBmC.gif" rel="nofollow noreferrer">and this is what I want</a></p>
  
  <p>This code in my presenter, onSelectedChanged and clearView only to demonstrate clearly how items are selected.</p>
  
  <pre><code>    addedCitiesRecycler.setLayoutManager(llmAddedCities);
  
      adapterAddedCities = new AdapterAddedCities();
  
  
      ItemTouchHelper.SimpleCallback callback = new ItemTouchHelper.SimpleCallback(ItemTouchHelper.UP | ItemTouchHelper.DOWN, ItemTouchHelper.START | ItemTouchHelper.END) {
          @Override
          public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
              adapterAddedCities.onItemMove(viewHolder.getAdapterPosition(), target.getAdapterPosition());
              return true;
          }
  
          @Override
          public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
              adapterAddedCities.onItemDismiss(viewHolder.getAdapterPosition());
          }
  
          @Override
          public void onSelectedChanged(RecyclerView.ViewHolder viewHolder, int actionState) {
              if (actionState != ItemTouchHelper.ACTION_STATE_IDLE) {
                  AdapterAddedCities.ViewHolder holder = (AdapterAddedCities.ViewHolder) viewHolder;
                  holder.itemView.setBackgroundColor(Color.LTGRAY);
              }
              super.onSelectedChanged(viewHolder, actionState);
          }
  
          @Override
          public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
              AdapterAddedCities.ViewHolder holder = (AdapterAddedCities.ViewHolder) viewHolder;
              holder.itemView.setBackgroundColor(0);
          }
      };
  
      itemTouchHelper = new ItemTouchHelper(callback);
      itemTouchHelper.attachToRecyclerView(addedCitiesRecycler);
  </code></pre>
  
  <p>this methods in my adapter</p>
  
  <pre><code>public void onItemDismiss(int position) {
      citiesData.remove(position);
      notifyItemRemoved(position);
  }
  
  public void onItemMove(int fromPosition, int toPosition) {
      CityInfo tmp = citiesData.remove(fromPosition);
      citiesData.add(toPosition &gt; fromPosition ? toPosition - 1 : toPosition, tmp);
      notifyItemMoved(fromPosition, toPosition);
  }
  </code></pre>