Does not scroll to the top of the solution not the time to expand grouping android development ExpandableListView

// set the packet to the clicked event ExpandableListView 
binding.elvContactGroup.setOnGroupClickListener {parent, _, groupPosition, _ ->
IF (parent.isGroupExpanded (groupPosition)) {
parent.collapseGroup (groupPosition)
} the else {
parent.expandGroup (groupPosition, to false) // The second parameter passed false, no animation
}
true // returns true if the event has consumption, to tell the system does not generate a default action.
}

 

Guess you like

Origin www.cnblogs.com/yongfengnice/p/11916960.html
Recommended