SwitchButton
SwitchButton copied to clipboard
Disable Animation During RecyclerView Scrolling
I don't want the animation to constantly change while scrolling through the RecyclerView. How can I solve this?
I just want it to be animated while I'm checking out. For example switchButton.setChecked(boolean state, boolean animate);
Can you make such a method? @zcweng @IvanAbakumov @msdx I found a solution like this, but it is not healthy at all. I first remove the animation with enable effect and then turn it on during touch, but this is not the right approach. Can you please create a solution like I said?
holder.switchButton.setEnableEffect(false);
holder.switchButton.setChecked(itemModels.get(position).isEnabled());
holder.switchButton.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
holder.switchButton.setEnableEffect(true);
return false;
}
});
已收到!
Can you add something like this? @zcweng
switchButton.setChecked(boolean state, boolean animate);