private void measureContentView(View child,
                                    int parentWidthMeasureSpec,
                                    int parentHeightMeasureSpec) {
        final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();

        final int childWidthMeasureSpec = getChildMeasureSpec(parentWidthMeasureSpec,
                getPaddingLeft() + getPaddingRight() + lp.leftMargin + lp.rightMargin, lp.width);
        final int childHeightMeasureSpec = getChildMeasureSpec(parentHeightMeasureSpec,
                getPaddingTop() + getPaddingBottom() + lp.topMargin, lp.height);

        child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
    }
This layout view for "Pull to Refresh(Ptr)" support all of the view, you can contain everything you want.
support: pull to refresh / release to refresh / auto refresh / keep header view while refreshing / hide header view while refreshing
It defines {@link in.srain.cube.views.ptr.PtrUIHandler}, which allows you customize the UI easily.
ptr-lib/src/in/srain/cube/views/ptr/PtrFrameLayout.java