@Override
    public Set<String> getCategories(final XmlRenderThemeStyleMenu menu) {
        themeStyleMenu = menu;
        final String id = this.sharedPreferences.getString(themeStyleMenu.getId(), themeStyleMenu.getDefaultValue());
        prefThemeStyleKey = menu.getId() + "-" + id;
        final XmlRenderThemeStyleLayer baseLayer = themeStyleMenu.getLayer(id);
        if (baseLayer == null) {
            Log.w("Invalid style " + id);
            return null;
        }
        final Set<String> result = baseLayer.getCategories();

        // add the categories from overlays that are enabled
        for (final XmlRenderThemeStyleLayer overlay : baseLayer.getOverlays()) {
            if (this.sharedPreferences.getBoolean(overlay.getId(), overlay.isEnabled())) {
                result.addAll(overlay.getCategories());
            }
        }

        return result;
    }
Callback handling for theme settings upon new Map Theme selection
Note: code was copied 1:1 in February 2021 from NewMap and might need refactoring.
<p>
Code works in conjunction with {@link MapsforgeThemeSettings} somehow.
Apparently map theme settings are "spilled" into c:geo shared preferences
(Observation: when using OpenAndroMaps Elevate, those settings usually related settings start with "elmt-")
main/src/main/java/cgeo/geocaching/unifiedmap/mapsforge/MapsforgeThemeHelper.java