epoxy
epoxy copied to clipboard
I use ModelGroup to make expand and collapse animation, but it brings performance problem when I set layoutParams to the rootView in bind method
abstract class VerticalExpandAnimModelGroup : GroupModel(R.layout.layout_vertical_expand_anim_model_group) {
override fun bind(holder: ModelGroupHolder) {
super.bind(holder)
val rootView = holder.rootView
if (!isExpand) {
rootView.layoutParams.apply {
height = 0
}
} else {
setWrapLayoutParams(rootView)
}
}
}```