Commit 90f4d8a6 authored by gaodapeng's avatar gaodapeng

增加了replaceData返回是否有变化的值

parent d42d7239
......@@ -85,8 +85,8 @@ public class ImageVideoBanner extends FrameLayout implements ViewPager.OnPageCha
}
public void replaceData(List<BannerBean> listBean) {
mAdapter.replaceData(listBean);
public boolean replaceData(List<BannerBean> listBean) {
return mAdapter.replaceData(listBean);
}
public void addData(List<BannerBean> listBean) {
......@@ -292,13 +292,12 @@ public class ImageVideoBanner extends FrameLayout implements ViewPager.OnPageCha
return super.getItemPosition(object);
}
public void replaceData(List<BannerBean> listBean) {
public boolean replaceData(List<BannerBean> listBean) {
// 新数据和原来数据对比,不一致才去刷新
boolean change = compareData(listBean);
if (!change) {
notifyDataSetChanged();
// startBanner();
return;
}
if (null != listBean) {
mList.clear();
......@@ -310,6 +309,7 @@ public class ImageVideoBanner extends FrameLayout implements ViewPager.OnPageCha
autoCurrIndex = 0;
// startBanner();
}
return change;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment