private void updateAttributes(final Activity activity) {
            final List<String> attributes = cache.getAttributes();
            if (!CacheAttribute.hasRecognizedAttributeIcon(attributes)) {
                binding.attributesGrid.setVisibility(View.GONE);
                return;
            }
            // traverse by category and attribute order
            final ArrayList<String> orderedAttributeNames = new ArrayList<>();
            final StringBuilder attributesText = new StringBuilder();
            CacheAttributeCategory lastCategory = null;
            for (CacheAttributeCategory category : CacheAttributeCategory.getOrderedCategoryList()) {
                for (CacheAttribute attr : CacheAttribute.getByCategory(category)) {
                    for (Boolean enabled : Arrays.asList(false, true, null)) {
                        final String key = attr.getValue(enabled);
                        if (attributes.contains(key)) {
                            if (lastCategory != category) {
                                if (lastCategory != null) {
                                    attributesText.append("<br /><br />");
                                }
                                attributesText.append("<b><u>").append(category.getName(activity)).append("</u></b><br />");
                                lastCategory = category;
                            } else {
                                attributesText.append("<br />");
                            }
                            orderedAttributeNames.add(key);
                            attributesText.append(attr.getL10n(enabled == null || enabled));
                        }
                    }
                }
            }

            binding.attributesGrid.setAdapter(new AttributesGridAdapter(activity, orderedAttributeNames, this::toggleAttributesView));
            binding.attributesGrid.setVisibility(View.VISIBLE);

            binding.attributesText.setText(HtmlCompat.fromHtml(attributesText.toString(), 0));
            binding.attributesText.setVisibility(View.GONE);
            binding.attributesText.setOnClickListener(v -> toggleAttributesView());
        }
Creator for details-view.
<br>
TODO: Extract inner class to own file for a better overview. Same might apply to all other view creators.
main/src/main/java/cgeo/geocaching/CacheDetailActivity.java