CymChad/BaserecyclerViewAdapterhelper framework

CymChad/BaserecyclerViewAdapterhelper (hereinafter referred to as Brvah) is a powerful Android Recyclerview rapid development framework that provides many convenient functions to simplify the use of RecyclerView.One of them is the function of customized animation effects. In BRVAH, we can achieve customized animation effects by using iTemanimator.ITEMANIMATOR is an internal class of RecyclerView, which is used to control the animation effect of adding, removing, moving, and refreshing item. To achieve customized animation effects, we need to inherit the Baseanimation class of BRVAH and rewrite the methods.The following is an example: import com.chad.library.adapter.base.animation.BaseAnimation; public class CustomAnimation extends BaseAnimation { @Override public Animator[] getAnimators(View view) { return new Animator[]{ ObjectAnimator.ofFloat(view, "alpha", 0f, 1f), ObjectAnimator.ofFloat(view, "translationY", view.getMeasuredHeight() / 2, 0) }; } } In the above example, we achieved a customized animation effect. The animation fade Item from a state of transparency 0 to 1 and moved from vertical direction to its original position. Then, we can apply the custom animation effect to the item of the customized animation effect in the following method: RecyclerView recyclerView = findViewById(R.id.recyclerView); BaseQuickAdapter adapter = new BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_layout, data) { @Override protected void convert(BaseViewHolder holder, String item) { // Set the contents of Item } }; recyclerView.setAdapter(adapter); recyclerView.setItemAnimator(new DefaultItemAnimator()); adapter.openLoadAnimation(new CustomAnimation()); In the above code, we created a BasequickAdapter instance and set up a RecyclerView adapter.Then, we set the default itemanimator to RecyclerView, and apply the custom animation effect to Adapter with adapter.openloadanimation () method. In this way, we can easily achieve customized animation effects in the BRVAH framework, and add unique and attractive dynamic effects to RecyclerView's item. To sum up, CymChad/BaserecyclerViewAdapterhelper framework can be achieved by inheriting the corresponding method by inheriting the BaseAnimation class and rewriting the corresponding method.The custom animation effect is applied to the ITEM in the RecyclerView by the adapter OpenLoadanimation () method.