Exemplo n.º 1
0
 @Override
 public void onDismissScreen() {
   Log.d("PunchBoxAd", "AdHandler.onDismissScreen");
   if (adType.compareToIgnoreCase("banner") != 0) {
     remove();
     listener.onDismissScreen();
   }
 }
Exemplo n.º 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();
   }
 }
Exemplo n.º 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();
  }
Exemplo n.º 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();
 }
Exemplo n.º 5
0
 @Override
 public void onFailedToReceiveAd(PBException arg0) {
   Log.d("PunchBoxAd", "AdHandler.onFailedToReceiveAd");
   listener.onFailedToReceiveAd(arg0);
 }