//给ExpandableListView设置分组点击事件binding.elvContactGroup.setOnGroupClickListener { parent, _, groupPosition, _ -> if (parent.isGroupExpanded(groupPosition)) { parent.collapseGroup(groupPosition) } else { parent.expandGroup(groupPosition, false)//第二个参数传递false,不产生动画 } true //返回true表示事件已经消费,告诉系统不再产生默认动作。}
原文地址:https://www.cnblogs.com/yongfengnice/p/11916960.html
时间: 2024-12-22 17:49:18