DrawerLayout去除阴影,阴影部分点击不关闭抽屉并可以触发相关view,抽屉侧滑可响应关闭

相关要求:DrawerLayout去除阴影,阴影部分点击不关闭抽屉并可以触发此处view,抽屉侧滑可响应关闭

对DrawerLayout的oninterceptTouchEvent进行处理:

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev){
        switch(ev.getAction()) {
            case MotionEvent.ACTION_DOWN:
                final float x = ev.getX();
                final float y = ev.getY();
                final View touchedView = findTopChildUnder((int) x, (int) y);
                if (touchedView != null && isContentView(touchedView)
                        && this.isDrawerOpen(GravityCompat.END)) {
                    return false;
                }
                break;

            default:
                break;
        }
        return super.onInterceptTouchEvent(ev);
    }

demo下载: http://download.csdn.net/detail/android_koukou/9887197

你可能感兴趣的:(Android)