title: How to stop swipe at some point in ItemTouchHelpers?
body: <p>I need to swipe an item at the beginning, or did a full swipe, or stopped in current point. As in the Yandex mail. I was tring to do <code>setLeft(dx)</code> and <code>setRight(dx)</code> but that's not what I need</p>
  
  <p>I have class </p>
  
  <pre><code>ItemTouchHelperCallback extends ItemTouchHelper.Callback 
  </code></pre>
  
  <p>and inside i override method </p>
  
  <pre><code>@Override
  public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
      View itemView = viewHolder.itemView;
  
      // not sure why, but this method get's called for viewholder that are already swiped away
      if (viewHolder.getAdapterPosition() == -1) {
          // not interested in those
          return;
      }
  
      float height = (float) itemView.getBottom() - (float) itemView.getTop();
      float width = height / 3;
      float temdX=0;
      Bitmap icon;
      if(dX &gt; 0 || lastdX&gt;0){
  
          //try stop item while back in dx=0, but workin only while i debug
          if(lastdX&gt;=100 &amp;&amp; dX==0 &amp;&amp;lastdX!=0 &amp;&amp;lastdX!=-720)
          {
              dX=100;
              isCurrentlyActive=true;
  
          }
          lastdX=dX;
          itemView.setLeft((int) dX);
          p.setColor(Color.GREEN);
          RectF background = new RectF((float) itemView.getLeft(), (float) itemView.getTop(), dX,(float) itemView.getBottom());
          c.drawRect(background,p);
          icon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.ic_y);
          RectF icon_dest = new RectF((float) itemView.getLeft() + width ,(float) itemView.getTop() + width, (float) itemView.getLeft()+ 2*width,(float)itemView.getBottom() - width);
          c.drawBitmap(icon, null, icon_dest, p);
  
  
      } else if(lastdX&lt;0 || dX&lt;0) {
          if(lastdX&lt;=-100 &amp;&amp; dX==0 &amp;&amp;lastdX!=0 &amp;&amp;lastdX!=720)
          {
              dX=-100;
              //itemView.setTranslationX(-200);
  
              isCurrentlyActive=true;
          }
          lastdX=dX;
          itemView.setRight((int)(dX));
          p.setColor(Color.RED);
          RectF background = new RectF((float) itemView.getRight() + dX, (float) itemView.getTop(),(float) itemView.getRight(), (float) itemView.getBottom());
          c.drawRect(background,p);
  
          icon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.ic_x);
          RectF icon_dest = new RectF((float) itemView.getRight() - 2*width ,(float) itemView.getTop() + width, (float) itemView.getRight() - width,(float)itemView.getBottom() - width);
          c.drawBitmap(icon,null,icon_dest,p);
  
      }
      super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
  }
  </code></pre>