protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int count = getChildCount();
        int maxWidth = 0;
        int maxHeight = 0;
        int maxChildBaseline = -1;
        int maxChildDescent = -1;
        int childState = 0;

        for (int i = 0; i < count; i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() == GONE) {
                continue;
            }

            measureChild(child, widthMeasureSpec, heightMeasureSpec);
            final int baseline = child.getBaseline();
            if (baseline != -1) {
                maxChildBaseline = Math.max(maxChildBaseline, baseline);
                maxChildDescent = Math.max(maxChildDescent, child.getMeasuredHeight() - baseline);
            }
            maxWidth = Math.max(maxWidth, child.getMeasuredWidth());
            maxHeight = Math.max(maxHeight, child.getMeasuredHeight());
            childState = childState | child.getMeasuredState();
        }
        if (maxChildBaseline != -1) {
            maxChildDescent = Math.max(maxChildDescent, getPaddingBottom());
            maxHeight = Math.max(maxHeight, maxChildBaseline + maxChildDescent);
            mBaseline = maxChildBaseline;
        }
        maxHeight = Math.max(maxHeight, getSuggestedMinimumHeight());
        maxWidth = Math.max(maxWidth, getSuggestedMinimumWidth());
        setMeasuredDimension(
                View.resolveSizeAndState(maxWidth, widthMeasureSpec, childState),
                View.resolveSizeAndState(maxHeight, heightMeasureSpec,
                        childState << MEASURED_HEIGHT_STATE_SHIFT));
    }
A simple ViewGroup that aligns all the views inside on a baseline. Note: bottom padding for this
view will be measured starting from the baseline.
pager-bottom-tab-strip/src/main/java/me/majiajie/pagerbottomtabstrip/internal/BaselineLayout.java