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);
}
}
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);
}
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;
}
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;
}
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);
}
Aggregations