title: How to set the swipe threshold to half the screen?
body: <p>I have a list (recycleView) of names.  Some names are short, some are long.  I want to delete them on swipe, but I want to make sure the user swipes more than half the distance of the <strong>screen</strong> (or width of list).  </p>
  
  <p>Currently it is going by the length of the individual item.</p>
  
  <p>I know how to swipe on delete.  I have tried overrideing getSwipeThreshold but again that uses the size of the item as its base.</p>
  
  <p>Here's code because SO wants code:</p>
  
  <pre><code>     RecyclerView recyclerView = findViewById(R.id.edit_list);
       final MyRecyclerViewAdapter adapter = new 
       MyRecyclerViewAdapter(this, qnames);
  
      //set swipe behavior
      ItemTouchHelper.SimpleCallback itemTouchHelperCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) {
          @Override
          public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
              return false;  //do not allow move
          }
  
          @Override
          public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
              // Row is swiped from recycler view
              int position = viewHolder.getAdapterPosition(); //get position which is swipe
              qnames.remove(position);  //remove from display list
              adapter.notifyItemRemoved(viewHolder.getLayoutPosition());  //update the view
  
          }
          @Override
          public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
              // view the background view
  
              super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
          }
  
          @Override
          public float getSwipeThreshold( RecyclerView.ViewHolder viewHolder){
  
              return .9f;
          }
  </code></pre>
  
  <p>Here's some pictures.</p>
  
  <p><a href="https://i.stack.imgur.com/eWLnM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eWLnM.png" alt="is delete"></a>
  <a href="https://i.stack.imgur.com/Y7V4U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y7V4U.png" alt="not deleted"></a></p>
  
  <p>So how do I set the swipe threshold to half the screen?</p>