@Override
  protected void onMeasureChild(final View child, final LayoutParams layoutParams) {
    final int viewType = layoutParams.viewType;
    final int position = layoutParams.position;

    if (viewType == ITEM_VIEW_TYPE_HEADER_OR_FOOTER || viewType == ITEM_VIEW_TYPE_IGNORE) {
      // for headers and weird ignored views
      super.onMeasureChild(child, layoutParams);
    } else {
      if (DBG)
        Log.d(TAG, "onMeasureChild BEFORE position:" + position + " h:" + getMeasuredHeight());
      // measure it to the width of our column.
      int childWidthSpec = MeasureSpec.makeMeasureSpec(mColumnWidth, MeasureSpec.EXACTLY);
      int childHeightSpec;
      if (layoutParams.height > 0) {
        childHeightSpec = MeasureSpec.makeMeasureSpec(layoutParams.height, MeasureSpec.EXACTLY);
      } else {
        childHeightSpec =
            MeasureSpec.makeMeasureSpec(LayoutParams.WRAP_CONTENT, MeasureSpec.UNSPECIFIED);
      }
      child.measure(childWidthSpec, childHeightSpec);
    }

    final int childHeight = getChildHeight(child);
    setPositionHeightRatio(position, childHeight);

    if (DBG) Log.d(TAG, "onMeasureChild AFTER position:" + position + " h:" + childHeight);
  }