use of org.qii.weiciyuan.bean.AdBean in project weiciyuan by qii.
the class TimeLineUtility method filterHomeTimeLineSinaWeiboAd.
public static void filterHomeTimeLineSinaWeiboAd(MessageListBean value) {
if (!SettingUtility.isFilterSinaAd()) {
return;
}
List<MessageBean> msgList = value.getItemList();
Iterator<MessageBean> iterator = msgList.iterator();
final List<AdBean> adBeanList = value.getAd();
if (adBeanList.size() > 0) {
AppLogger.i("filter " + adBeanList.size() + " sina weibo ads");
List<String> adIdList = new ArrayList<String>();
for (AdBean adBean : adBeanList) {
adIdList.add(adBean.getId());
}
while (iterator.hasNext()) {
MessageBean msg = iterator.next();
UserBean user = msg.getUser();
if (user == null) {
continue;
}
if (adIdList.contains(msg.getId())) {
iterator.remove();
value.removedCountPlus();
}
}
}
}
Aggregations