@SuppressWarnings({"PMD.NPathComplexity"})
        void fillData(final ListItem data) {
            if (data == null) {
                return;
            }

            switch (data.type) {
                case SELECT_ALL:
                    final String selectAllText = "<" + LocalizationUtils.getString(R.string.multiselect_selectall) + " (" + model.getSelectedItems().size() + "/" + model.getItems().size() + ")>";
                    applyItemView(binding, selectAllText, null, SELECT_VIEW_MAPPER);
                    binding.itemCheckbox.setChecked(model.getSelectedItems().size() == model.getItems().size());
                    binding.itemIcon.setVisibility(GONE);
                    break;
                case SELECTED_VISIBLE:
                    final String selectVisibleText = "<" + LocalizationUtils.getString(R.string.multiselect_selectvisible) + " (" + currentlyVisibleSelected + "/" + currentlyVisible + ")>";
                    applyItemView(binding, selectVisibleText, null, SELECT_VIEW_MAPPER);
                    binding.itemCheckbox.setChecked(currentlyVisibleSelected == currentlyVisible);
                    binding.itemIcon.setVisibility(GONE);
                    break;
                default:
                    //handling of groups and items
                    if (data.type == ListItemType.GROUPHEADER) {
                        applyItemView(binding, data.itemGroup.getGroup(), data.itemGroup, model.getGroupingOptions().getGroupDisplayViewMapper());
                    } else {
                        applyItemView(binding, data.value, data.itemGroup, model.getDisplayViewMapper());
                    }

                    final boolean showIcon = data.icon != null || (data.type == ListItemType.GROUPHEADER ? groupsHaveIcons : itemsHaveIcons);
                    if (showIcon) {
                        (data.icon == null ? ImageParam.TRANSPARENT : data.icon).applyTo(binding.itemIcon);
                        binding.itemIcon.setVisibility(VISIBLE);
                    } else {
                        binding.itemIcon.setVisibility(GONE);
                    }
                    if (data.actionIcon != null) {
                        final MaterialButton b = (MaterialButton) binding.itemAction;
                        data.actionIcon.applyToIcon(b);
                    }
                    binding.itemRadiobutton.setChecked(model.getSelectedItems().contains(data.value));
                    binding.itemCheckbox.setChecked(model.getSelectedItems().contains(data.value));
                    break;
            }

            final int groupPadding = Math.max(0, data.itemGroup == null ? 0 : data.itemGroup.getLevel() - (data.type == ListItemType.GROUPHEADER ? 1 : 0));
            binding.itemChecker.setPadding(ViewUtils.dpToPixel(34 * groupPadding), 0, 0, 0);

            binding.itemCheckbox.setVisibility(data.type != ListItemType.GROUPHEADER && model.getChoiceMode() == SimpleItemListModel.ChoiceMode.MULTI_CHECKBOX ? VISIBLE : GONE);
            binding.itemRadiobutton.setVisibility(data.type == ListItemType.ITEM && model.getChoiceMode() == SimpleItemListModel.ChoiceMode.SINGLE_RADIO ? VISIBLE : GONE);
            binding.itemGroupToggle.setVisibility(data.type == ListItemType.GROUPHEADER ? VISIBLE : GONE);
            binding.groupExpanded.setVisibility(data.type == ListItemType.GROUPHEADER && isGroupExpanded(data.itemGroup.getGroup()) ? VISIBLE : GONE);
            binding.groupReduced.setVisibility(data.type == ListItemType.GROUPHEADER && !isGroupExpanded(data.itemGroup.getGroup()) ? VISIBLE : GONE);
            binding.itemAction.setVisibility(data.type == ListItemType.ITEM && data.actionIcon != null ? VISIBLE : GONE);
        }
This view displays and maintains a list of simple view items, mainly for (single or multiple)
item selection lists. It provides special support for grouping, filtering and "select all" for such
lists.
main/src/main/java/cgeo/geocaching/ui/SimpleItemListView.java