@Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        mInLayout = true;
        final int height = b - t;
        final int childCount = getChildCount();
        for (int i = 0; i < childCount; i++) {
            final View child = getChildAt(i);

            if (child.getVisibility() == GONE) {
                continue;
            }

            final LayoutParams lp = (LayoutParams) child.getLayoutParams();

            if (isContentView(child)) {
                child.layout(lp.leftMargin, lp.topMargin,
                        lp.leftMargin + child.getMeasuredWidth(),
                        lp.topMargin + child.getMeasuredHeight());
            } else { // Drawer, if it wasn't onMeasure would have thrown an exception.
                final int childWidth = child.getMeasuredWidth();
                final int childHeight = child.getMeasuredHeight();
                int childTop;

                final float newOffset;
                if (checkDrawerViewAbsoluteGravity(child, Gravity.TOP)) {
                    childTop = -childHeight + (int) (childHeight * lp.onScreen);
                    newOffset = (float) (childHeight + childTop) / childHeight;
                } else { // Right; onMeasure checked for us.
                    childTop = height - (int) (childHeight * lp.onScreen);
                    newOffset = (float) (height - childTop) / childHeight;
                }

                final boolean changeOffset = newOffset != lp.onScreen;

                final int vgrav = lp.gravity & Gravity.VERTICAL_GRAVITY_MASK;

                switch (vgrav) {
                    default:
                    case Gravity.TOP: {
                        child.layout(lp.leftMargin, childTop, lp.leftMargin + childWidth,
                                childTop + childHeight);
                        break;
                    }

                    case Gravity.BOTTOM: {
                        final int width = r - l;
                        child.layout(width - lp.rightMargin - child.getMeasuredWidth(),
                                childTop,
                                width - lp.rightMargin,
                                childTop + childHeight);
                        break;
                    }

                    case Gravity.CENTER_VERTICAL: {
                        final int width = r - l;
                        int childLeft = (width - childWidth) / 2;

                        // Offset for margins. If things don't fit right because of
                        // bad measurement before, oh well.
                        if (childLeft < lp.topMargin) {
                            childLeft = lp.topMargin;
                        } else if (childLeft + childWidth > width - lp.rightMargin) {
                            childLeft = width - lp.rightMargin - childWidth;
                        }
                        child.layout(childLeft, childTop, childLeft + childWidth,
                                childTop + childHeight);
                        break;
                    }
                }

                if (changeOffset) {
                    setDrawerViewOffset(child, newOffset);
                }

                final int newVisibility = lp.onScreen > 0 ? VISIBLE : INVISIBLE;
                if (child.getVisibility() != newVisibility) {
                    child.setVisibility(newVisibility);
                }
            }
        }
        mInLayout = false;
        mFirstLayout = false;
    }
Change the layout direction of the given drawable.
Return true if auto-mirror is supported and drawable's layout direction can be changed.
Otherwise, return false.
app/src/main/java/com/sunnyweather/android/ui/customerUIs/HomeDrawerLayout.java