rowItem.item.yTopPos = top; rowItem.item.yBottomPos = bottom;
        private void rowBreak(int lineWidth) {                if (this.currentRow.size() == 0) {                        return; // Current row is empty                }                /**                 * Horizontal Layout Starts Here!                 */                // Take away all the horizontal paddings                int remainingWidth = lineWidth                                - ((this.currentRow.size() - 1) * this.paddingHorizontal);                RowItem[] requiredExpanded = null;                int requiredExpandedIndex = 0;                for (int i = 0; i < this.currentRow.size(); i++) {                    RowItem rowItem = (RowItem) this.currentRow.get(i);                    remainingWidth -= rowItem.width;                    if (Item.LAYOUT_EXPAND == (rowItem.item.getLayout() & Item.LAYOUT_EXPAND)) {                        if (requiredExpanded == null) {                            requiredExpanded = new RowItem[this.currentRow.size() - i];                        }                        requiredExpanded[requiredExpandedIndex++] = rowItem;                    }                }                // Distribute the remaining width to the items that require expanding                if (requiredExpanded != null) {                    int expansion = remainingWidth / requiredExpandedIndex;                    remainingWidth = remainingWidth % requiredExpandedIndex;                    for (int i = 0; i < requiredExpandedIndex; i++) {                        RowItem rowItem = requiredExpanded[i];                        rowItem.width += expansion;                        if (i == 0) {                            // The first item get all the rounding                            rowItem.width += remainingWidth;                        }                    }                }                // Horizontal Positioning determined by the first item in a row                RowItem rowItem = (RowItem) this.currentRow.get(0);                int rowHorizontalLayout = (rowItem.item.getLayout() & LAYOUT_HORIZONTAL);                if (requiredExpanded != null) {                	rowHorizontalLayout = Item.LAYOUT_LEFT;                }                int x = 0;                switch (rowHorizontalLayout) {                    case Item.LAYOUT_CENTER :                        x = (remainingWidth >> 1);                        break;                    case Item.LAYOUT_RIGHT :                        x = remainingWidth;                        break;                }                for (int i = 0; i < this.currentRow.size(); i++) {	                rowItem = (RowItem) this.currentRow.get(i);	                rowItem.x = x;	                x += rowItem.width + this.paddingHorizontal; // Next Item		                /**	                 * Vertical Layout starts here	                 */	                int layout = rowItem.item.getLayout();	                rowItem.y = this.contentHeight;	                if (Item.LAYOUT_VEXPAND == (layout & Item.LAYOUT_VEXPAND)) {                        // Vertical expansion is required, ignore all other                        rowItem.height = this.rowHeight;	                } else {                        layout = (layout & LAYOUT_VERTICAL);                        switch (layout) {	                        case Item.LAYOUT_VCENTER :	                            rowItem.y += ((this.rowHeight - rowItem.height) >> 1);	                            break;                            case Item.LAYOUT_BOTTOM :                                rowItem.y += this.rowHeight - rowItem.height;                                break;                        }	                }                }                if (this.allRows.size() == 0) {	                // Adding first row	                this.contentHeight += this.rowHeight;                } else {                    this.contentHeight += this.paddingVertical + this.rowHeight;                }                if ( this.rowWidth > this.contentWidth ) {	                this.contentWidth = this.rowWidth;                }                // Get ready for next row                this.allRows.add(this.currentRow);                this.rowHeight = this.rowWidth = 0;                this.currentRow = new ArrayList();        }