Пример #1
0
 @Override
 public boolean onInterceptTouchEvent(final MotionEvent ev) {
   if (ev.getAction() == MotionEvent.ACTION_DOWN) {
     parent.animateClose();
   }
   return super.onInterceptTouchEvent(ev);
 }
Пример #2
0
 @Override
 public boolean onInterceptTouchEvent(final ViewGroup view, final MotionEvent event) {
   mShouldDisableScroll =
       !(isTouchEventHandled(view, event)
           || mContext instanceof DualPaneActivity
               && ((DualPaneActivity) mContext).isRightPaneUsed());
   switch (event.getAction()) {
     case MotionEvent.ACTION_DOWN:
       {
         mFirstDownHandled = !mShouldDisableScroll;
         mTempDeltaX = 0;
         mTotalMoveX = 0;
         mTotalMoveY = 0;
         mActualMoveX = 0;
         mIsVerticalScrolling = false;
         if (mFirstDownHandled) {
           mParent.animateOpen();
         }
         break;
       }
     case MotionEvent.ACTION_MOVE:
       {
         final int hist_size = event.getHistorySize();
         if (hist_size == 0) {
           break;
         }
         mTempDeltaX = event.getX() - event.getHistoricalX(0);
         mTotalMoveX += mTempDeltaX;
         final float deltaY = event.getY() - event.getHistoricalY(0);
         mTotalMoveY += deltaY;
         if (Math.abs(mTempDeltaX) > Math.abs(deltaY)
             && !mIsVerticalScrolling
             && Math.abs(mTotalMoveX) >= mScaledTouchSlop) return true;
         if (Math.abs(mTempDeltaX) < Math.abs(deltaY)
             && Math.abs(mTotalMoveY) >= mScaledTouchSlop) {
           mIsVerticalScrolling = true;
           return false;
         }
         break;
       }
   }
   return false;
 }
Пример #3
0
 ShadowTouchListener(final SlidingPaneView parent) {
   mContext = parent.getContext();
   mScaledTouchSlop = ViewConfiguration.get(parent.getContext()).getScaledTouchSlop();
   mController = parent.getController();
 }
Пример #4
0
 ScrollTouchInterceptor(final SlidingPaneView parent) {
   mParent = parent;
   mScaledTouchSlop = ViewConfiguration.get(parent.getContext()).getScaledTouchSlop();
   mController = parent.getController();
   mContext = parent.getContext();
 }
Пример #5
0
 public FadingRightPaneContainer(final SlidingPaneView parent) {
   super(parent.getContext());
 }
Пример #6
0
 public RightPaneLayout(final SlidingPaneView parent) {
   super(parent.getContext());
   setOrientation(LinearLayout.HORIZONTAL);
 }
Пример #7
0
 public LeftPaneLayout(final SlidingPaneView parent) {
   super(parent.getContext());
   this.parent = parent;
 }