Search in sources :

Example 1 with NativeExpressADView

use of com.qq.e.ads.nativ.NativeExpressADView in project Palm300Heroes by nicolite.

the class NewsPresenter method showBannerAD.

public void showBannerAD() {
    LogUtils.d(TAG, "showBannerAD");
    NativeExpressAD nativeExpressAD = new NativeExpressAD(getActivity().getActivity(), new ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT), Constants.AD_APPID, Constants.NEWS_BANNER_AD_ID, new NativeExpressAD.NativeExpressADListener() {

        @Override
        public void onNoAD(AdError adError) {
            LogUtils.i(TAG, String.format(Locale.CHINA, "onADError, error code: %d, error msg: %s", adError.getErrorCode(), adError.getErrorMsg()));
            if (getView() != null) {
                getView().loadBannerADFailure();
            }
        }

        @Override
        public void onADLoaded(List<NativeExpressADView> list) {
            LogUtils.i(TAG, "onADLoaded: " + list.size());
            if (getView() != null) {
                getView().showBannerAD(list);
            }
        }

        @Override
        public void onRenderFail(NativeExpressADView nativeExpressADView) {
            LogUtils.i(TAG, "onRenderFail");
        }

        @Override
        public void onRenderSuccess(NativeExpressADView nativeExpressADView) {
            LogUtils.i(TAG, "onRenderSuccess");
        }

        @Override
        public void onADExposure(NativeExpressADView nativeExpressADView) {
            LogUtils.i(TAG, "onADExposure");
        }

        @Override
        public void onADClicked(NativeExpressADView nativeExpressADView) {
            LogUtils.i(TAG, "onADClicked");
        }

        @Override
        public void onADClosed(NativeExpressADView nativeExpressADView) {
            LogUtils.i(TAG, "onADClosed");
        }

        @Override
        public void onADLeftApplication(NativeExpressADView nativeExpressADView) {
            LogUtils.i(TAG, "onADLeftApplication");
        }

        @Override
        public void onADOpenOverlay(NativeExpressADView nativeExpressADView) {
            LogUtils.i(TAG, "onADOpenOverlay");
        }

        @Override
        public void onADCloseOverlay(NativeExpressADView nativeExpressADView) {
            LogUtils.i(TAG, "onADCloseOverlay");
        }
    });
    nativeExpressAD.loadAD(1);
}
Also used : ADSize(com.qq.e.ads.nativ.ADSize) NativeExpressAD(com.qq.e.ads.nativ.NativeExpressAD) AdError(com.qq.e.comm.util.AdError) NativeExpressADView(com.qq.e.ads.nativ.NativeExpressADView)

Aggregations

ADSize (com.qq.e.ads.nativ.ADSize)1 NativeExpressAD (com.qq.e.ads.nativ.NativeExpressAD)1 NativeExpressADView (com.qq.e.ads.nativ.NativeExpressADView)1 AdError (com.qq.e.comm.util.AdError)1