private void layoutVertical(int top, int bottom, int left, int right) {
        int topY = paddingTop;

        int width = right - left;
        int childRight = width - paddingRight;
        int availableWidth = width - paddingLeft - paddingRight;

        for (int i = 0; i < getChildCount(); i++) {
            View child = getChildAt(i);
            if (!child.getVisibility().equals(Visibility.GONE)) {
                int leftX = 0;
                int childWidth = child.getMeasuredWidth() - 1;
                int childHeight = child.getMeasuredHeight();
                LayoutParameters params = (LayoutParameters) child.getLayoutParameters();

                int rawAlignment = params.getAlignment();
                Alignment alignment = Alignment.getVerticalAlignment(rawAlignment);
                switch (alignment) {
                case LEFT:
                    leftX = paddingLeft + params.getLeftMargin();
                    break;
                case RIGHT:
                    leftX = childRight - childWidth - params.getRightMargin();
                    break;
                case CENTER_HORIZONTAL:
                    leftX = paddingLeft + ((availableWidth - childWidth) / 2) + params.getLeftMargin() - params.getRightMargin();
                    if (params.centered) {
                        int height = bottom - top;
                        int availableHeight = height - paddingTop - paddingBottom;
                        topY = paddingTop + ((availableHeight - childHeight) / 2);
                    }
                    break;
                default:
                    leftX = paddingLeft + params.getLeftMargin();
                }

                topY += params.getTopMargin();
                setChildLayout(child, leftX, topY, childWidth, childHeight);
                topY += childHeight + params.getBottomMargin();
            }
        }
    }