use of com.amazon.device.ads.AdLayout in project Klyph by jonathangerbaud.
the class AmazonBanner method createAdView.
@Override
public View createAdView(Activity activity, ViewGroup adContainer, final IBannerCallback callback) {
Log.d("AmazonBanner", "createAdView: ");
final AdLayout adView = new AdLayout(activity, AdSize.SIZE_300x250);
adView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
adView.setListener(new com.amazon.device.ads.AdListener() {
@Override
public void onAdLoaded(AdLayout adView, AdProperties arg1) {
callback.onReceiveAd(adView);
}
@Override
public void onAdFailedToLoad(AdLayout adView, AdError error) {
callback.onFailedToReceiveAd(adView, error.getMessage());
}
@Override
public void onAdExpanded(AdLayout arg0) {
}
@Override
public void onAdCollapsed(AdLayout arg0) {
}
});
return adView;
}
use of com.amazon.device.ads.AdLayout in project Klyph by jonathangerbaud.
the class AmazonBanner method loadAd.
@Override
public void loadAd(View adView) {
Log.d("AmazonBanner", "loadAd: ");
//AdRegistration.enableTesting(true);
AdRegistration.enableLogging(true);
((AdLayout) adView).loadAd(new AdTargetingOptions());
}
Aggregations