Beispiel #1
0
 @Override
 public boolean onInterceptTouchEvent(final MotionEvent ev) {
   if (ev.getAction() == MotionEvent.ACTION_DOWN) {
     parent.animateClose();
   }
   return super.onInterceptTouchEvent(ev);
 }
Beispiel #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;
 }
Beispiel #3
0
 ShadowTouchListener(final SlidingPaneView parent) {
   mContext = parent.getContext();
   mScaledTouchSlop = ViewConfiguration.get(parent.getContext()).getScaledTouchSlop();
   mController = parent.getController();
 }
Beispiel #4
0
 ScrollTouchInterceptor(final SlidingPaneView parent) {
   mParent = parent;
   mScaledTouchSlop = ViewConfiguration.get(parent.getContext()).getScaledTouchSlop();
   mController = parent.getController();
   mContext = parent.getContext();
 }
Beispiel #5
0
 public FadingRightPaneContainer(final SlidingPaneView parent) {
   super(parent.getContext());
 }
Beispiel #6
0
 public RightPaneLayout(final SlidingPaneView parent) {
   super(parent.getContext());
   setOrientation(LinearLayout.HORIZONTAL);
 }
Beispiel #7
0
 public LeftPaneLayout(final SlidingPaneView parent) {
   super(parent.getContext());
   this.parent = parent;
 }