|
|
@@ -93,16 +93,17 @@ public class FgtFindChild extends BaseListFragment5<Article> {
|
|
|
protected void loadList(List<Article> addList) {
|
|
|
if (showAd) {
|
|
|
ListUtil.addAll(allList, addList);
|
|
|
- if (1 == page) {
|
|
|
- Article item = ListUtil.getItem(allList, ArticleAd.INDEX);
|
|
|
+// if (1 == page) {
|
|
|
+ int index = (page - 1) * (per_page + 1) + ArticleAd.INDEX;
|
|
|
+ Article item = ListUtil.getItem(allList, index);
|
|
|
if (!(item instanceof ArticleAd)) {//倒数第几个不是广告的情况下才添加
|
|
|
- ArticleAd.fetchNativeData(articleAd -> ListUtil.insertIndex(allList, articleAd, ArticleAd.INDEX), ok -> {
|
|
|
+ ArticleAd.fetchNativeData(articleAd -> ListUtil.insertIndex(allList, articleAd, index), ok -> {
|
|
|
if (ok) {
|
|
|
notifyDataSetChanged();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
super.loadList(addList);
|
|
|
}
|
|
|
@@ -268,7 +269,7 @@ public class FgtFindChild extends BaseListFragment5<Article> {
|
|
|
ArticleTag articleTag = DataUtil.getObject(bundle, ArticleTag.class);
|
|
|
if (articleTag != null) {
|
|
|
type = articleTag.getId();
|
|
|
- showAd = ArticleAd.showAd && TextUtils.equals(articleTag.getName(), "资讯");//只有资讯才显示
|
|
|
+ showAd = ArticleAd.showAd;//修改回之前的所有栏目都展示 && TextUtils.equals(articleTag.getName(), "资讯");//只有资讯才显示
|
|
|
}
|
|
|
}
|
|
|
EventBus.getDefault().register(this);
|