Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
1.3 kB
3
Indexable
Never
fun checkFilter(filter: String, sections: List<DynamicMenuSection>) {
    val sectionsWithoutIconAndDescription = sections.let {
        it.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
                            }
                        }
                    }
                }
            }
        }
        it
    }
    if (filter.isEmpty()) {
        view.hideInlineInfoView()
        view.setAdapterContent(sections)
    } else {
        analyticsValue = filter
        view.setAdapterContentFilter(sectionsWithoutIconAndDescription, filter)
    }
}