SwitchButton icon indicating copy to clipboard operation
SwitchButton copied to clipboard

Disable Animation During RecyclerView Scrolling

Open deneme721a opened this issue 10 months ago • 2 comments

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;
    }
});

deneme721a avatar Apr 21 '24 08:04 deneme721a

已收到!

developmans avatar Apr 21 '24 08:04 developmans

Can you add something like this? @zcweng

switchButton.setChecked(boolean state, boolean animate);

deneme721a avatar Apr 21 '24 08:04 deneme721a