@Override
    protected Parcelable onSaveInstanceState() {
        final Parcelable superState = super.onSaveInstanceState();
        final SavedState ss = new SavedState(superState);

        final int childCount = getChildCount();
        for (int i = 0; i < childCount; i++) {
            final View child = getChildAt(i);
            LayoutParams lp = (LayoutParams) child.getLayoutParams();
            // Is the current child fully opened (that is, not closing)?
            boolean isOpenedAndNotClosing = (lp.openState == LayoutParams.FLAG_IS_OPENED);
            // Is the current child opening?
            boolean isClosedAndOpening = (lp.openState == LayoutParams.FLAG_IS_OPENING);
            if (isOpenedAndNotClosing || isClosedAndOpening) {
                // If one of the conditions above holds, save the child's gravity
                // so that we open that child during state restore.
                ss.openDrawerGravity = lp.gravity;
                break;
            }
        }

        ss.lockModeTop = mLockModeTop;
        ss.lockModeBottom = mLockModeBottom;
        ss.lockModeStart = mLockModeStart;
        ss.lockModeEnd = mLockModeEnd;

        return ss;
    }
Check if a given drawer view is currently visible on-screen. The drawer
may be only peeking onto the screen, fully extended, or anywhere in between.
If there is no drawer with the given gravity this method will return false.

@param drawerGravity Gravity of the drawer to check
@return true if the given drawer is visible on-screen
app/src/main/java/com/sunnyweather/android/ui/customerUIs/HomeDrawerLayout.java