drawerlayout/src/main/java/androidx/drawerlayout/widget/DrawerLayout.java
public void openDrawer(@NonNull View drawerView, boolean animate) {
        if (!isDrawerView(drawerView)) {
            throw new IllegalArgumentException("View " + drawerView + " is not a sliding drawer");
        }

        final LayoutParams lp = (LayoutParams) drawerView.getLayoutParams();
        if (mFirstLayout) {
            lp.onScreen = 1.f;
            lp.openState = LayoutParams.FLAG_IS_OPENED;

            updateChildrenImportantForAccessibility(drawerView, true);
        } else if (animate) {
            lp.openState |= LayoutParams.FLAG_IS_OPENING;

            if (checkDrawerViewAbsoluteGravity(drawerView, Gravity.LEFT)) {
                mLeftDragger.smoothSlideViewTo(drawerView, 0, drawerView.getTop());
            } else {
                mRightDragger.smoothSlideViewTo(drawerView, getWidth() - drawerView.getWidth(),
                        drawerView.getTop());
            }
        } else {
            moveDrawerToOffset(drawerView, 1.f);
            updateDrawerState(lp.gravity, STATE_IDLE, drawerView);
            drawerView.setVisibility(VISIBLE);
        }
        invalidate();
    }
/**
     * Open the specified drawer view.
     *
     * @param drawerView Drawer view to open
     * @param animate Whether opening of the drawer should be animated.
     */
Open the specified drawer view.
@param drawerView Drawer view to open
@param animate Whether opening of the drawer should be animated.
Open the specified drawer view . @param drawerView Drawer view to open @param animate Whether opening of the drawer should be animated .
public void openDrawer(@NonNull View drawerView, boolean animate) {
        if (!isDrawerView(drawerView)) {
            throw new IllegalArgumentException("View " + drawerView + " is not a sliding drawer");
        }
        final LayoutParams lp = (LayoutParams) drawerView.getLayoutParams();
        if (mFirstLayout) {
            lp.onScreen = 1.f;
            lp.openState = LayoutParams.FLAG_IS_OPENED;
            updateChildrenImportantForAccessibility(drawerView, true);
        } else if (animate) {
            lp.openState |= LayoutParams.FLAG_IS_OPENING;
            if (checkDrawerViewAbsoluteGravity(drawerView, Gravity.LEFT)) {
                mLeftDragger.smoothSlideViewTo(drawerView, 0, drawerView.getTop());
            } else {
                mRightDragger.smoothSlideViewTo(drawerView, getWidth() - drawerView.getWidth(),
                        drawerView.getTop());
            }
        } else {
            moveDrawerToOffset(drawerView, 1.f);
            updateDrawerState(lp.gravity, STATE_IDLE, drawerView);
            drawerView.setVisibility(VISIBLE);
        }
        invalidate();
    }
public void openDrawer ( @ NonNull View drawerView , boolean animate ) { if ( ! isDrawerView ( drawerView ) ) { throw new IllegalArgumentException ( "View " + drawerView + " is not a sliding drawer" ) ; } final LayoutParams lp = ( LayoutParams ) drawerView . getLayoutParams ( ) ; if ( mFirstLayout ) { lp . onScreen = 1.f ; lp . openState = LayoutParams . FLAG_IS_OPENED ; updateChildrenImportantForAccessibility ( drawerView , true ) ; } else if ( animate ) { lp . openState |= LayoutParams . FLAG_IS_OPENING ; if ( checkDrawerViewAbsoluteGravity ( drawerView , Gravity . LEFT ) ) { mLeftDragger . smoothSlideViewTo ( drawerView , 0 , drawerView . getTop ( ) ) ; } else { mRightDragger . smoothSlideViewTo ( drawerView , getWidth ( ) - drawerView . getWidth ( ) , drawerView . getTop ( ) ) ; } } else { moveDrawerToOffset ( drawerView , 1.f ) ; updateDrawerState ( lp . gravity , STATE_IDLE , drawerView ) ; drawerView . setVisibility ( VISIBLE ) ; } invalidate ( ) ; }
Open the specified drawer view.
Open the specified drawer view .