-
Notifications
You must be signed in to change notification settings - Fork 6
Advanced integration of adinline recyclerview
rprunskas edited this page May 11, 2016
·
2 revisions
The Adform Advertising SDK includes a RecyclerView.Adapter class called AdformRecyclerViewAdapter
. This class automatically inserts AdInline banners into your content.
Create AdformRecyclerViewAdapter
adapter using original adapter reference, master tag, ad size, and AdformRecyclerViewAdParams
interface implementation. You have to return a number in showAdEveryNTime()
method which specifies how often ad will be shown in the RecyclerView
, this number should be greater than 0. If you want to use custom layout params, you have to implement createAdRelativeLayoutParams
, return null to stick with default params.
RecyclerView recyclerView = (RecyclerView) yourView.findViewById(R.id.your_recycler_view);
recyclerView.setLayoutManager(yourLayoutManager);
AdformRecyclerViewAdapter adformRecyclerViewAdapter
= new AdformRecyclerViewAdapter(adapter, your-master-tag, new AdSize(320,50), new AdformRecyclerViewAdParams() {
@Override
public int showAdEveryNTime() {
return 3;
}
@Override
@Nullable
public RelativeLayout.LayoutParams createAdRelativeLayoutParams() {
RelativeLayout.LayoutParams layoutParams
= new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL, RelativeLayout.TRUE);
layoutParams.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE);
return layoutParams;
}
});
recyclerView.setAdapter(adformRecyclerViewAdapter);
Basic integrations
- Integrating Inline Ad
- Integrating Full Screen Overlay Ad
- Integrating Interstitial Ad
- Integrating Adhesion Ad
- Video Ad Integration
Advanced integrations
- Advanced integration of Inline Ad
- Advanced integration of Full Screen Overlay Ad
- Advanced integration of Interstitial Ad
- Advanced integration of Adhesion Ad
- Advanced integration of AdInline ListView
- Advanced integration of AdInline RecyclerView
- Instream video ads integration
Other
- Adding Custom Values
- Adding Keywords
- Adding Key Value Pairs
- Adding Search Words
- Location
- Security
- Ad Tags
- Header Bidding
- Changing ADX domain
- Specifying banner loading behaviour
- GDPR
- Logs
Mediation adapters
Plugins