From 42698dd739a6f7291173a82a1b9993720fda6117 Mon Sep 17 00:00:00 2001 From: machiav3lli Date: Fri, 4 Mar 2022 15:22:33 +0100 Subject: [PATCH] Update: Replace deprecated function --- .../com/looker/droidify/ui/fragments/ExploreFragment.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/looker/droidify/ui/fragments/ExploreFragment.kt b/src/main/kotlin/com/looker/droidify/ui/fragments/ExploreFragment.kt index 98ef88b1..f817dab7 100644 --- a/src/main/kotlin/com/looker/droidify/ui/fragments/ExploreFragment.kt +++ b/src/main/kotlin/com/looker/droidify/ui/fragments/ExploreFragment.kt @@ -86,13 +86,14 @@ class ExploreFragment : MainNavFragmentX() { val selectedSection = viewModel.sections.value check( children.filterNotNull() - .find { it is Chip && selectedSection is Category && it.text == selectedSection.name }?.id - ?: R.id.SHOW_ALL + .find { child -> + child is Chip && selectedSection is Category && child.text == selectedSection.name + }?.id ?: R.id.SHOW_ALL ) } } - binding.categories.setOnCheckedChangeListener { group, checkedId -> - group.findViewById(checkedId).let { + binding.categories.setOnCheckedStateChangeListener { group, checkedIds -> + group.findViewById(checkedIds[0]).let { viewModel.setSection( if (it.text.equals(getString(R.string.all_applications))) Section.All