Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
1.2 kB
3
Indexable
Never
private fun removeIconAndDescription(sections: List<DynamicMenuSection>): List<DynamicMenuSection> {
    return sections.map { section ->
        val modifiedContent = section.content?.map { content ->
            DynamicMenuContent(
                content.id,
                content.title,
                content.name,
                content.colorText,
                content.badgeNotification,
                null,  // Remove description
                content.highlight,
                content.keep,
                null,  // Remove icon
                content.colorIcon,
                content.accessibility,
                content.analytics,
                content.tag,
                content.action,
                content.badge,
                content.toggle,
                content.validate,
                content.separator,
                content.isUnavailable,
                null,  // Remove children
                content.unavailability
            )
        }
        DynamicMenuSection(
            section.title,
            modifiedContent,
            section.toggle,
            section.validate
        )
    }
}