Configure native ads using a Banner ad placement. (Note: Currently, only native self-rendering types are supported.)
View SDK Version Corresponding Supported Ad Source Types, Ad Networks, and Rendering Methods

ATBannerView#setNativeAdCustomRender() method before loading the ad, as follows:ATBannerView mBannerView = new ATBannerView(activity);
mBannerView.setNativeAdCustomRender(new ATNativeAdCustomRender() {
@Override
public View getMediationViewFromNativeAd(ATNativeAdInfo mixNativeAd, ATAdInfo atAdInfo) {
//You can render the ad assets returned by the SDK into a View according to your own needs and return it here
//For details, refer to: https://github.com/toponteam/TPN-Android-Demo
return MediationNativeAdUtil.getViewFromNativeAd(activity, mixNativeAd, atAdInfo, false);
}
});
mBannerView.loadAd();

TUBannerView#setNativeAdCustomRender() method before loading the ad, as follows:TUBannerView mBannerView = new TUBannerView(activity);
mBannerView.setNativeAdCustomRender(new TUNativeAdCustomRender() {
@Override
public View getMediationViewFromNativeAd(TUNativeAdInfo mixNativeAd, TUAdInfo adInfo) {
//You can render the ad assets returned by the SDK into a View according to your own needs and return it here
//For details, refer to: https://github.com/toponteam/TPN-Android-Demo
return MediationNativeAdUtil.getViewFromNativeAd(activity, mixNativeAd, adInfo, false);
}
});
mBannerView.loadAd();
Note:
- When the Developer Self-Rendering method is set in the TopOn dashboard, if the code does not implement self-rendering to return the ad View, it will default to using the SDK's built-in layout style for rendering.
- When the Developer Self-Rendering method is set in the TopOn dashboard and the code implements self-rendering to return the ad View, the ad background will default to fully transparent; you need to implement the half-screen and full-screen effects yourself.