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