# HG changeset patch # User John Tsiombikas # Date 1444276458 -10800 # Node ID 900651a2f401a5c18aa00d102ec03b8f6db889a0 # Parent c6c45fa9658dbc5dc2a515c3fe7e5c13cd9812ee foo diff -r c6c45fa9658d -r 900651a2f401 src/android/MainActivity.java --- a/src/android/MainActivity.java Thu Oct 08 04:55:45 2015 +0300 +++ b/src/android/MainActivity.java Thu Oct 08 06:54:18 2015 +0300 @@ -49,6 +49,7 @@ super.onDestroy(); } + /* @Override public void onAttachedToWindow() { @@ -56,6 +57,7 @@ create_ad_popup(); } + */ @Override public void onWindowFocusChanged(boolean focus) @@ -83,6 +85,7 @@ } } + /* public void onConfigurationChanged(Configuration config) { super.onConfigurationChanged(config); @@ -90,6 +93,7 @@ destroy_ad_popup(); create_ad_popup(); } + */ public void set_fullscreen() { @@ -138,7 +142,6 @@ act.setContentView(ad_main_layout, params); - ad_view = new AdView(act); ad_view.setAdSize(AdSize.BANNER); ad_view.setAdUnitId(ad_id_test); @@ -167,16 +170,10 @@ Log.e(tag, "ad failed to load, error code: " + error_code); ad_ready = false; waiting_for_ad = false; - request_ad(); } }); - - if(!waiting_for_ad) { - request_ad(); - } - Log.i(tag, "Done creating ad popup"); } }); @@ -213,14 +210,14 @@ { Log.i(tag, "show_ad called"); + if(ad_win == null) { + create_ad_popup(); + } + if(ad_ready) { - if(ad_win == null) { - create_ad_popup(); - } - ad_view.setVisibility(View.VISIBLE); + //ad_view.setVisibility(View.VISIBLE); ad_win.showAtLocation(ad_main_layout, Gravity.TOP, 0, 0); ad_win.update(); - Log.i(tag, "showing ad window: " + ad_win); } else { if(!waiting_for_ad) { request_ad(); @@ -232,9 +229,7 @@ { Log.i(tag, "hide_ad called"); //ad_view.setVisibility(View.GONE); - Log.i(tag, "hiding ad window: " + ad_win); ad_win.dismiss(); - ad_win.update(); //ad_win.update(); //destroy_ad_popup(); ad_ready = false; diff -r c6c45fa9658d -r 900651a2f401 src/android/amain.c --- a/src/android/amain.c Thu Oct 08 04:55:45 2015 +0300 +++ b/src/android/amain.c Thu Oct 08 06:54:18 2015 +0300 @@ -80,7 +80,6 @@ { } -/* TODO */ void ad_banner_show(void) { jmethodID method; @@ -114,6 +113,8 @@ case APP_CMD_INIT_WINDOW: printf("APP_CMD_INIT_WINDOW\n"); + ad_banner_show(); + if(init_gl() == -1) { exit(1); }