Search in sources :

Example 1 with AdProperties

use of com.amazon.device.ads.AdProperties 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;
}
Also used : LayoutParams(android.widget.RelativeLayout.LayoutParams) AdLayout(com.amazon.device.ads.AdLayout) AdProperties(com.amazon.device.ads.AdProperties) AdError(com.amazon.device.ads.AdError)

Aggregations

LayoutParams (android.widget.RelativeLayout.LayoutParams)1 AdError (com.amazon.device.ads.AdError)1 AdLayout (com.amazon.device.ads.AdLayout)1 AdProperties (com.amazon.device.ads.AdProperties)1