protected boolean onMoveAllowDrag(int x, int y, float dx, float dy) {
        switch (getPosition()) {
            case LEFT:
                return (!mMenuVisible && mInitialMotionX <= mTouchSize && (dx > 0))
                        || (mMenuVisible && x >= mOffsetPixels);

            case RIGHT:
                final int width = getWidth();
                return (!mMenuVisible && mInitialMotionX >= width - mTouchSize && (dx < 0))
                        || (mMenuVisible && x <= width + mOffsetPixels);

            case TOP:
                return (!mMenuVisible && mInitialMotionY <= mTouchSize && (dy > 0))
                        || (mMenuVisible && y >= mOffsetPixels);

            case BOTTOM:
                final int height = getHeight();
                return (!mMenuVisible && mInitialMotionY >= height - mTouchSize && (dy < 0))
                        || (mMenuVisible && y <= height + mOffsetPixels);
        }

        return false;
    }
Offsets the menu relative to its original position based on the position of the content.

@param offsetPixels The number of pixels the content if offset.
menudrawer/src/net/simonvt/menudrawer/SlidingDrawer.java