title: OnSwipe method not working in RecyclerView
body: <p>I'm working on an app for playing audio files. Created a tab layout with 2 tabs. Used fragment in both of them with <code>RecyclerView</code> being used in both of them. The fragment named <code>LibraryFragment</code> has this <code>RecycleView</code> whose items when Swipped must pass on to the <code>HomeFragment</code>, that's what I wanna do. <strong>But even though swiping animation is happening, <code>OnSwipe</code> method doesn't works at all.</strong></p>
  
  <p>This is the method I've used to provide the swiping function to my recyclerview's items under the <code>LibraryFragment</code>. Under <code>OnCreateView</code> method I call this <code>initSwipe()</code> method.</p>
  
  <pre><code> private void initSwipe(){
      ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT ) {
  
  
          private boolean swipeBack = false;
          @Override
          public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
              return false;
          }
  
          @Override
          public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
              int position = viewHolder.getAdapterPosition();
  
            if (direction == ItemTouchHelper.LEFT){
                  HomeFragment.audioList.clear();
                  HomeFragment.audioList.add(audioList.get(position));
                  HomeFragment.libraryAdapter.notifyDataSetChanged();
              Log.e(TAG, "onSwiped: " );
              }
          }
  
  
          @Override
          public void onChildDraw(Canvas c, RecyclerView recyclerView,
                                  RecyclerView.ViewHolder viewHolder, float dX, float dY,
                                  int actionState, boolean isCurrentlyActive) {
              recyclerView.setOnTouchListener(new View.OnTouchListener() {
                  @Override
                  public boolean onTouch(View v, MotionEvent event)
                  {
                      if(event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL)
                      {
                          swipeBack = true;
                      }
                      else
                      {
                          swipeBack = false;
                      }
                      return false;
                  }
  
              });
              super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
          }
  
          @Override
          public int convertToAbsoluteDirection(int flags, int layoutDirection) {
              int value = swipeBack ? 0 : super.convertToAbsoluteDirection(flags, layoutDirection);
              swipeBack = false;
              return value;
          }
  
  
      };
      ItemTouchHelper itemTouchHelper = new ItemTouchHelper(simpleItemTouchCallback);
      itemTouchHelper.attachToRecyclerView(libraryRecyclerView);
  }
  </code></pre>
  
  <p>please help out.</p>