Search in sources :

Example 1 with AdBean

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();
            }
        }
    }
}
Also used : MessageBean(org.qii.weiciyuan.bean.MessageBean) UserBean(org.qii.weiciyuan.bean.UserBean) DMUserBean(org.qii.weiciyuan.bean.DMUserBean) AdBean(org.qii.weiciyuan.bean.AdBean) ArrayList(java.util.ArrayList) SpannableString(android.text.SpannableString)

Aggregations

SpannableString (android.text.SpannableString)1 ArrayList (java.util.ArrayList)1 AdBean (org.qii.weiciyuan.bean.AdBean)1 DMUserBean (org.qii.weiciyuan.bean.DMUserBean)1 MessageBean (org.qii.weiciyuan.bean.MessageBean)1 UserBean (org.qii.weiciyuan.bean.UserBean)1