示例#1
0
 @Override
 public void onDismissScreen() {
   Log.d("PunchBoxAd", "AdHandler.onDismissScreen");
   if (adType.compareToIgnoreCase("banner") != 0) {
     remove();
     listener.onDismissScreen();
   }
 }
示例#2
0
 private void removeBannerAd() {
   if (bannerAd != null) {
     bannerAd.setAdListener(null);
     ViewGroup bannerAdParent = (ViewGroup) bannerAd.getParent();
     ViewGroup group = (ViewGroup) bannerAdParent.getParent();
     group.removeView(bannerAdParent);
     bannerAd = null;
     listener.onDismissScreen();
   }
 }
示例#3
0
  @Override
  public void onPresentScreen() {
    Log.d("PunchBoxAd", "AdHandler.onPresentScreen");

    if (adType.compareToIgnoreCase("banner") == 0) {
      ViewGroup group = (ViewGroup) bannerAd.getParent().getParent();
      group.findViewById(Cocos2dxActivity.GLVIEW_ID).requestFocus();
    }

    listener.onPresentScreen();
  }
示例#4
0
 @Override
 public void onReceiveAd() {
   Log.d("PunchBoxAd", "AdHandler.onReceiveAd");
   if (adType.compareToIgnoreCase("moregame") == 0 && moreGameAd != null) {
     try {
       moreGameAd.showFloatView(context, 1.0, adId);
     } catch (PBException e) {
       e.printStackTrace();
     }
   } else if (adType.compareToIgnoreCase("interstitial") == 0 && interstitialAd != null) {
     try {
       interstitialAd.showFloatView(context, 1.0, adId);
     } catch (PBException e) {
       e.printStackTrace();
     }
   }
   listener.onReceiveAd();
 }
示例#5
0
 @Override
 public void onFailedToReceiveAd(PBException arg0) {
   Log.d("PunchBoxAd", "AdHandler.onFailedToReceiveAd");
   listener.onFailedToReceiveAd(arg0);
 }