itgoyo / AndroidSummary

12 stars 4 forks source link

ListView经常出现的复用问题的核心代码 #124

Open itgoyo opened 4 years ago

itgoyo commented 4 years ago
video_preview = classInfo.getVIDEO_PREVIEW();
        viewHolder.mLl_yuxi.setTag(video_preview);
        if (viewHolder.mLl_yuxi.getTag() != null && viewHolder.mLl_yuxi.getTag().equals(video_preview)) {
            viewHolder.mLl_yuxi.setTag(null);
            if (!TextUtils.isEmpty(video_preview)) {

                viewHolder.mLl_yuxi.setVisibility(View.VISIBLE);
            } else {
                viewHolder.mLl_yuxi.setVisibility(View.INVISIBLE);
            }
        } else {
            viewHolder.mLl_yuxi.setVisibility(View.INVISIBLE);
        }