如何重置datas?
leveychen opened this issue · 1 comments
leveychen commented
如何更新内容?
直接setDatas 没效果。 重新设置 factory 会导致重叠。
@Subscribe
public void onNoticeEvent(MarqueeNoticeEvent event) {
MarqueeFactory<TextView, NoticePojo.NoticeListBean> marqueeFactory = new NoticeMF(this);
marqueeFactory.setOnItemClickListener(new MarqueeFactory.OnItemClickListener<TextView, NoticePojo.NoticeListBean>() {
@Override
public void onItemClickListener(MarqueeFactory.ViewHolder<TextView, NoticePojo.NoticeListBean> holder) {
Sys.toast(getApplicationContext(), "" + holder.data.getTitle());
}
});
marqueeFactory.setData(event.getDatas());
marqueeNotice.setMarqueeFactory(marqueeFactory);
marqueeNotice.setAnimInAndOut(R.anim.right_in, R.anim.left_out);
marqueeNotice.setAnimDuration(20000);
marqueeNotice.setInterval(25000);
marqueeNotice.startFlipping();
}
gongwen commented
你用marqueeFactory.resetData替代marqueeFactory.setData就行了,你得更新下library