title: Disable Swipe for position in RecyclerView using ItemTouchHelper.SimpleCallback
body: <p>I am using recyclerview 22.2.0 and the helper class ItemTouchHelper.SimpleCallback to enable <em>swipe-to-dismiss</em> option to my list. But as I have a type of header on it, I need to disable the swipe behavior for the first position of the adapter. As <strong>RecyclerView.Adapter</strong> doesn't have a <strong>isEnabled()</strong> method, I tried to disable the view interaction through the methods <strong>isEnabled()</strong> and <strong>isFocusable()</strong> in the ViewHolder creation itself, but had no success. I tried to adjust the swipe threshold to a full value, like <strong>0f</strong> ot <strong>1f</strong> in the SimpleCallback's method <strong>getSwipeThreshold()</strong>, but no success too.</p>
  
  <p>Some fragments of my code to help you to help me.</p>
  
  <p><strong>My Activity:</strong></p>
  
  <pre><code>@Override
  protected void onCreate(Bundle bundle) {
      //... initialization
      ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0,
              ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) {
  
          @Override
          public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder,
                            RecyclerView.ViewHolder target) {
              return false;
          }
  
          @Override
          public float getSwipeThreshold(RecyclerView.ViewHolder viewHolder) {
              if (viewHolder instanceof CartAdapter.MyViewHolder) return 1f;
              return super.getSwipeThreshold(viewHolder);
          }
  
          @Override
          public void onSwiped(RecyclerView.ViewHolder viewHolder, int swipeDir) {
  
          }
      };
  
      ItemTouchHelper itemTouchHelper = new ItemTouchHelper(simpleItemTouchCallback);
      itemTouchHelper.attachToRecyclerView(recyclerView);
  }
  </code></pre>
  
  <p>And I have a common adapter with <em>two</em> view types. In the <em>ViewHolder</em> that I want to disable swiping, I did:</p>
  
  <pre><code>public static class MyViewHolder extends RecyclerView.ViewHolder {
      public ViewGroup mContainer;
  
      public MyViewHolder(View v) {
          super(v);
          v.setFocusable(false);
          v.setEnabled(false);
          mContainer = (ViewGroup) v.findViewById(R.id.container);      
      }
  }
  </code></pre>