istereo2

diff src/android/MainActivity.java @ 30:900651a2f401

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 08 Oct 2015 06:54:18 +0300
parents c6c45fa9658d
children 48a0660bac82
line diff
     1.1 --- a/src/android/MainActivity.java	Thu Oct 08 04:55:45 2015 +0300
     1.2 +++ b/src/android/MainActivity.java	Thu Oct 08 06:54:18 2015 +0300
     1.3 @@ -49,6 +49,7 @@
     1.4  		super.onDestroy();
     1.5  	}
     1.6  
     1.7 +	/*
     1.8  	@Override
     1.9  	public void onAttachedToWindow()
    1.10  	{
    1.11 @@ -56,6 +57,7 @@
    1.12  
    1.13  		create_ad_popup();
    1.14  	}
    1.15 +	*/
    1.16  
    1.17  	@Override
    1.18  	public void onWindowFocusChanged(boolean focus)
    1.19 @@ -83,6 +85,7 @@
    1.20  		}
    1.21  	}
    1.22  
    1.23 +	/*
    1.24  	public void onConfigurationChanged(Configuration config)
    1.25  	{
    1.26  		super.onConfigurationChanged(config);
    1.27 @@ -90,6 +93,7 @@
    1.28  		destroy_ad_popup();
    1.29  		create_ad_popup();
    1.30  	}
    1.31 +	*/
    1.32  
    1.33  	public void set_fullscreen()
    1.34  	{
    1.35 @@ -138,7 +142,6 @@
    1.36  				act.setContentView(ad_main_layout, params);
    1.37  
    1.38  
    1.39 -
    1.40  				ad_view = new AdView(act);
    1.41  				ad_view.setAdSize(AdSize.BANNER);
    1.42  				ad_view.setAdUnitId(ad_id_test);
    1.43 @@ -167,16 +170,10 @@
    1.44  						Log.e(tag, "ad failed to load, error code: " + error_code);
    1.45  						ad_ready = false;
    1.46  						waiting_for_ad = false;
    1.47 -
    1.48  						request_ad();
    1.49  					}
    1.50  				});
    1.51  
    1.52 -
    1.53 -				if(!waiting_for_ad) {
    1.54 -					request_ad();
    1.55 -				}
    1.56 -
    1.57  				Log.i(tag, "Done creating ad popup");
    1.58  			}
    1.59  		});
    1.60 @@ -213,14 +210,14 @@
    1.61  	{
    1.62  		Log.i(tag, "show_ad called");
    1.63  
    1.64 +		if(ad_win == null) {
    1.65 +			create_ad_popup();
    1.66 +		}
    1.67 +
    1.68  		if(ad_ready) {
    1.69 -			if(ad_win == null) {
    1.70 -				create_ad_popup();
    1.71 -			}
    1.72 -			ad_view.setVisibility(View.VISIBLE);
    1.73 +			//ad_view.setVisibility(View.VISIBLE);
    1.74  			ad_win.showAtLocation(ad_main_layout, Gravity.TOP, 0, 0);
    1.75  			ad_win.update();
    1.76 -			Log.i(tag, "showing ad window: " + ad_win);
    1.77  		} else {
    1.78  			if(!waiting_for_ad) {
    1.79  				request_ad();
    1.80 @@ -232,9 +229,7 @@
    1.81  	{
    1.82  		Log.i(tag, "hide_ad called");
    1.83  		//ad_view.setVisibility(View.GONE);
    1.84 -		Log.i(tag, "hiding ad window: " + ad_win);
    1.85  		ad_win.dismiss();
    1.86 -		ad_win.update();
    1.87  		//ad_win.update();
    1.88  		//destroy_ad_popup();
    1.89  		ad_ready = false;