Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clear old images before setting up new images #7

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

w-xuefeng
Copy link

In the RecyclerView, if a drop-down refresh is used, the images will be added to an item multiple times. Therefore, it is necessary to execute clear() once to clear the old data before executing 'setImages()'.

RecyclerView 中, 如果使用了下拉刷新,则会在一个 item 中多次添加图片。因此需要在执行 setImages() 之前,先执行一次 clear() 清除原来的旧数据.

@zhazhaxin
Copy link
Owner

In the RecyclerView, if a drop-down refresh is used, the images will be added to an item multiple times. Therefore, it is necessary to execute clear() once to clear the old data before executing 'setImages()'.

RecyclerView 中, 如果使用了下拉刷新,则会在一个 item 中多次添加图片。因此需要在执行 setImages() 之前,先执行一次 clear() 清除原来的旧数据.

不太需要吧?mData = data;会换掉整个数据源

@w-xuefeng
Copy link
Author

In the RecyclerView, if a drop-down refresh is used, the images will be added to an item multiple times. Therefore, it is necessary to execute clear() once to clear the old data before executing 'setImages()'.

RecyclerView 中, 如果使用了下拉刷新,则会在一个 item 中多次添加图片。因此需要在执行 setImages() 之前,先执行一次 clear() 清除原来的旧数据.

不太需要吧?mData = data;会换掉整个数据源

我遇到的问题和这个 issue一样,应该具有普适性,所以建议将

mMultiView.clear();
mMultiView.setImages(pics);

中的 clear() 方法放在 setImages() 内部调用,开发者使用的时候就不用自己处理了。

@zhazhaxin
Copy link
Owner

In the RecyclerView, if a drop-down refresh is used, the images will be added to an item multiple times. Therefore, it is necessary to execute clear() once to clear the old data before executing 'setImages()'.

RecyclerView 中, 如果使用了下拉刷新,则会在一个 item 中多次添加图片。因此需要在执行 setImages() 之前,先执行一次 clear() 清除原来的旧数据.

不太需要吧?mData = data;会换掉整个数据源

我遇到的问题和这个 issue一样,应该具有普适性,所以建议将

mMultiView.clear();
mMultiView.setImages(pics);

中的 clear() 方法放在 setImages() 内部调用,开发者使用的时候就不用自己处理了。

嗯。你可以改得彻底点。不希望这样改代码哈。改彻底了提个 PR 吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants