Prevent showing groups with no cards in them

This commit is contained in:
drdev
2014-07-17 03:30:11 +00:00
parent 0ee0f9e0f1
commit c09b003f19
2 changed files with 15 additions and 11 deletions

View File

@@ -572,17 +572,19 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
} }
groupY = y; groupY = y;
if (group.items.isEmpty()) {
group.setBounds(groupX, groupY, groupWidth, 0);
continue;
}
if (groupBy != null) { if (groupBy != null) {
y += GROUP_HEADER_HEIGHT + PADDING; //leave room for group header y += GROUP_HEADER_HEIGHT + PADDING; //leave room for group header
if (group.isCollapsed || group.items.isEmpty()) { if (group.isCollapsed) {
group.setBounds(groupX, groupY, groupWidth, GROUP_HEADER_HEIGHT); group.setBounds(groupX, groupY, groupWidth, GROUP_HEADER_HEIGHT);
continue; continue;
} }
} }
else if (group.items.isEmpty()) {
group.setBounds(groupX, groupY, groupWidth, 0);
continue;
}
if (pileBy == null) { if (pileBy == null) {
//if not piling by anything, wrap items using a pile for each row //if not piling by anything, wrap items using a pile for each row

View File

@@ -450,19 +450,21 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
} }
groupY = y; groupY = y;
if (group.items.isEmpty()) {
group.setBounds(groupX, groupY, groupWidth, 0);
group.scrollWidth = groupWidth;
continue;
}
if (groupBy != null) { if (groupBy != null) {
y += GROUP_HEADER_HEIGHT + PADDING; //leave room for group header y += GROUP_HEADER_HEIGHT + PADDING; //leave room for group header
if (group.isCollapsed || group.items.isEmpty()) { if (group.isCollapsed) {
group.setBounds(groupX, groupY, groupWidth, GROUP_HEADER_HEIGHT); group.setBounds(groupX, groupY, groupWidth, GROUP_HEADER_HEIGHT);
group.scrollWidth = groupWidth; group.scrollWidth = groupWidth;
continue; continue;
} }
} }
else if (group.items.isEmpty()) {
group.setBounds(groupX, groupY, groupWidth, 0);
group.scrollWidth = groupWidth;
continue;
}
if (pileBy == null) { if (pileBy == null) {
//if not piling by anything, wrap items using a pile for each row //if not piling by anything, wrap items using a pile for each row