Search in sources :

Example 1 with NewsBanner

use of cn.nicolite.palm300heroes.model.bean.NewsBanner in project Palm300Heroes by nicolite.

the class NewsFragment method showBannerAD.

@Override
public void showBannerAD(List<NativeExpressADView> adList) {
    LogUtils.d(TAG, "showBannerAD");
    if (nativeExpressADView != null) {
        nativeExpressADView.destroy();
    }
    if (!ListUtils.isEmpty(adList)) {
        nativeExpressADView = adList.get(0);
        if (ListUtils.isEmpty(bannerList)) {
            model.add(0, " ");
            tips.add(0, " ");
            bannerList.add(0, new NewsBanner());
            bannerViewList.add(0, nativeExpressADView);
        } else {
            model.add(1, " ");
            tips.add(1, " ");
            bannerList.add(1, new NewsBanner());
            bannerViewList.add(1, nativeExpressADView);
        }
        nativeExpressADView.render();
    }
    if (!ListUtils.isEmpty(model) && !ListUtils.isEmpty(tips)) {
        bgaBanner.setData(bannerViewList, model, tips);
    }
}
Also used : NewsBanner(cn.nicolite.palm300heroes.model.bean.NewsBanner)

Example 2 with NewsBanner

use of cn.nicolite.palm300heroes.model.bean.NewsBanner in project Palm300Heroes by nicolite.

the class NewsFragment method showBanner.

@Override
public void showBanner(List<NewsBanner> bannerList) {
    this.bannerList.clear();
    this.bannerList.addAll(bannerList);
    for (NewsBanner newsBanner : bannerList) {
        ImageView imageView = new ImageView(context);
        bannerViewList.add(imageView);
        model.add(newsBanner.getImage());
        tips.add(newsBanner.getTitle());
    }
// bgaBanner.setData(bannerViewList, model, tips);
}
Also used : ImageView(android.widget.ImageView) NewsBanner(cn.nicolite.palm300heroes.model.bean.NewsBanner)

Example 3 with NewsBanner

use of cn.nicolite.palm300heroes.model.bean.NewsBanner in project Palm300Heroes by nicolite.

the class NewsModel method getTyBannerNiang.

public static List<NewsBanner> getTyBannerNiang(Document document) {
    List<NewsBanner> list = new ArrayList<>();
    Elements niang = document.body().getElementsByClass("niang");
    Elements img = niang.select("img");
    Elements a = niang.select("a");
    for (int i = 0; i < Math.min(a.size(), img.size()); i++) {
        NewsBanner newsBanner = new NewsBanner();
        newsBanner.setUrl(a.get(i).attr("abs:href"));
        String url = img.get(i).attr("style").replace("background: url(", "").replace(") no-repeat center;", "").trim();
        newsBanner.setImage(url);
        newsBanner.setTitle(" ");
        list.add(newsBanner);
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) NewsBanner(cn.nicolite.palm300heroes.model.bean.NewsBanner) Elements(org.jsoup.select.Elements)

Example 4 with NewsBanner

use of cn.nicolite.palm300heroes.model.bean.NewsBanner in project Palm300Heroes by nicolite.

the class NewsModel method getTYBannerA.

// http://300c.jumpw.com/
public static List<NewsBanner> getTYBannerA(Document document) {
    List<NewsBanner> list = new ArrayList<>();
    Elements ad_gd = document.body().getElementsByClass("ad_gd");
    Elements a = ad_gd.select("a");
    Elements img = ad_gd.select("img");
    for (int i = 0; i < Math.min(a.size(), img.size()); i++) {
        NewsBanner newsBanner = new NewsBanner();
        newsBanner.setUrl(a.get(i).attr("abs:href"));
        String url = img.get(i).attr("style").replace("background: url(", "").replace(") no-repeat center;", "").trim();
        newsBanner.setImage(url);
        newsBanner.setTitle(" ");
        list.add(newsBanner);
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) NewsBanner(cn.nicolite.palm300heroes.model.bean.NewsBanner) Elements(org.jsoup.select.Elements)

Example 5 with NewsBanner

use of cn.nicolite.palm300heroes.model.bean.NewsBanner in project Palm300Heroes by nicolite.

the class TYAreaListFragment method showBanner.

@Override
public void showBanner(List<NewsBanner> bannerList) {
    this.bannerList.clear();
    this.bannerList.addAll(bannerList);
    for (NewsBanner newsBanner : bannerList) {
        ImageView imageView = new ImageView(context);
        bannerViewList.add(imageView);
        model.add(newsBanner.getImage());
        tips.add(newsBanner.getTitle());
    }
    bgaBanner.setData(bannerViewList, model, tips);
}
Also used : ImageView(android.widget.ImageView) NewsBanner(cn.nicolite.palm300heroes.model.bean.NewsBanner)

Aggregations

NewsBanner (cn.nicolite.palm300heroes.model.bean.NewsBanner)7 ImageView (android.widget.ImageView)3 ArrayList (java.util.ArrayList)3 Elements (org.jsoup.select.Elements)3 Bundle (android.os.Bundle)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 View (android.view.View)1 BindView (butterknife.BindView)1 BGABanner (cn.bingoogolapple.bgabanner.BGABanner)1 TYAreaPresenter (cn.nicolite.palm300heroes.presenter.TYAreaPresenter)1 WebViewActivity (cn.nicolite.palm300heroes.view.activity.WebViewActivity)1 TYAreaAdapter (cn.nicolite.palm300heroes.view.adapter.TYAreaAdapter)1 ITYAreaView (cn.nicolite.palm300heroes.view.iview.ITYAreaView)1 OnNetWorkErrorListener (com.github.jdsjlzx.interfaces.OnNetWorkErrorListener)1 OnRefreshListener (com.github.jdsjlzx.interfaces.OnRefreshListener)1 LRecyclerView (com.github.jdsjlzx.recyclerview.LRecyclerView)1 LRecyclerViewAdapter (com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter)1 NativeExpressADView (com.qq.e.ads.nativ.NativeExpressADView)1 Element (org.jsoup.nodes.Element)1