protected int getRowWidth(int columnSpan) { final int rowWidth = listView.getColumnWidth() * columnSpan; // when the item spans multiple columns, we need to account for the horizontal padding // and add that to the total final width return Math.min( rowWidth + ((columnSpan - 1) * listView.getRequestedHorizontalSpacing()), Utils.getScreenWidth(getContext())); }