Untitled
unknown
plain_text
2 years ago
1.4 kB
9
Indexable
fun checkFilter(filter: String, sections: List<DynamicMenuSection>) {
val sectionsWithoutIconAndDescription = sections.toMutableList()
if (filter.isEmpty()) {
view.hideInlineInfoView()
view.setAdapterContent(sections)
} else {
analyticsValue = filter
view.setAdapterContentFilter(removeIconAndDescription(sectionsWithoutIconAndDescription), filter)
}
}
private fun removeIconAndDescription(sections: MutableList<DynamicMenuSection>) : List<DynamicMenuSection> {
sections.forEach { dynamicMenuSection ->
dynamicMenuSection.content?.forEach { dynamicMenuContent ->
dynamicMenuContent.icon = null
dynamicMenuContent.description = null
dynamicMenuContent.children?.forEach { dynamicMenuSection ->
dynamicMenuSection.content?.forEach { dynamicMenuSectionContent ->
dynamicMenuSectionContent.description = null
dynamicMenuSectionContent.children?.forEach { dynamicMenuSectionContentChildren ->
dynamicMenuSectionContentChildren.content?.forEach { dynamicMenuSectionContentLastChildren ->
dynamicMenuSectionContentLastChildren.description = null
}
}
}
}
}
}
return sections
}Editor is loading...