1. Solutions

Replace notifyDataSetChanged() with notifyItemRangeChanged(int positionStart, int itemCount);

The code for HomeAdapter adapter is as follows:

public void appendData(List dataSet) { int positon = this.listData.size(); if (dataSet ! = null && ! dataSet.isEmpty()) { this.listData.addAll(dataSet); // notifyDataSetChanged(); /** * Replace notifyDataSetChanged */ notifyItemRangeChanged(positon, dataSet.size()); }}Copy the code

2. Adapter HomeAdapter: Glide loading picture, setTag

/** * Solve the sliding recyclerView cause glide image loading flicker * 1. SkipMemoryCache (true), skip cache */ if (! Bean. The getImage () equals (articleViewHolder. Iv. GetTag (R.i d.i v_hot))) {/ / loading pictures Glide.with(activity).load(bean.getImage()).skipMemoryCache(true) // .apply(options) .into(articleViewHolder.iv); articleViewHolder.iv.setTag(R.id.iv_hot, bean.getImage()); }Copy the code

If set to false, the animation will not be displayed and the flicker problem will be solved. The code is really a sentence.

((SimpleItemAnimator)recyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
Copy the code