示例#1
0
 @Override
 public boolean onTouch(View v, MotionEvent event) {
   if (event.getPointerCount() > 1) {
     if (mGestureDetector.onTouchEvent(event)) return true;
   } else {
     if (mVisibleGrid == GRID_SMALL) {
       return mSmallRecView.onTouchEvent(event);
     } else if (mVisibleGrid == GRID_BIG) {
       return mBigRecView.onTouchEvent(event);
     }
   }
   return false;
 }
 @Override
 public boolean onTouchEvent(@NonNull MotionEvent event) {
   if (mRecyclerWantsTouchEvent) {
     int scrollDiff = mCurrentScroll - mDownScroll;
     MotionEvent recyclerEvent =
         MotionEvent.obtain(
             event.getDownTime(),
             event.getEventTime(),
             event.getAction(),
             event.getX(),
             event.getY() - scrollDiff,
             event.getMetaState());
     mRecycler.onTouchEvent(recyclerEvent);
     return false;
   }
   return super.onTouchEvent(event);
 }