It wraps your Adapter to display Admob native ads and banners in a ListView/RecyclerView data set. It based on the Yahoo fetchr project https://github.com/yahoo/fetchr
Apache License 2.0
237
stars
75
forks
source link
Display items in RecyclerViews with GridLayoutManager #112
When I used Express ads in RecyclerView with GridLayoutManager I follow code below
rvMessages.setAdapter(adapterWrapper);GridLayoutManager mLayoutManager = new GridLayoutManager(this, 2);mLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {@Overridepublic int getSpanSize(int position) {//set span 2 for ad block, otherwise 1if(adapterWrapper.getItemViewType(position) == adapterWrapper.getViewTypeAdExpress())return 2;else return 1;}});rvMessages.setLayoutManager(mLayoutManager);
Now I migrate to Advanced ads but didnt find any code for this operation.
How to use adapterWrapper with Advanced ads in RecyclerView with GridLayoutManager?
Thanks
Admobadapter version or commit: 1.4.6
Android compileSdkVersion: 27
Issue description briefly:
When I used Express ads in RecyclerView with GridLayoutManager I follow code below
rvMessages.setAdapter(adapterWrapper);
GridLayoutManager mLayoutManager = new GridLayoutManager(this, 2);
mLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
//set span 2 for ad block, otherwise 1
if(adapterWrapper.getItemViewType(position) == adapterWrapper.getViewTypeAdExpress())
return 2;
else return 1;
}
});
rvMessages.setLayoutManager(mLayoutManager);
Now I migrate to Advanced ads but didnt find any code for this operation. How to use adapterWrapper with Advanced ads in RecyclerView with GridLayoutManager? Thanks