Untitled
unknown
plain_text
2 years ago
1.3 kB
11
Indexable
private fun removeIconAndDescription(sections: List<DynamicMenuSection>): List<DynamicMenuSection> {
return sections.map { section ->
val modifiedContent = section.content?.map { content ->
removeDescriptionFromContent(content)
}
DynamicMenuSection(
section.title,
modifiedContent,
section.toggle,
section.validate
)
}
}
private fun removeDescriptionFromContent(content: DynamicMenuContent?): DynamicMenuContent? {
if (content == null) return null
val modifiedChildren = content.children?.map { child ->
removeDescriptionFromContent(child)
}
return 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,
modifiedChildren,
content.unavailability
)
}Editor is loading...