X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Ffree%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2FBannerAd.java;h=c9263c27dec9ebe5205a829976bae38a4dacc607;hp=9cfe9ab2d112dfe0cf05ebef1150c6eb951eac4e;hb=897b2d7f61a0492f228e3c172d7c6a76e3c5f3ac;hpb=77756d29db4d52a35a3999f67b101e22525c97e2 diff --git a/app/src/free/java/com/stoutner/privacybrowser/BannerAd.java b/app/src/free/java/com/stoutner/privacybrowser/BannerAd.java index 9cfe9ab2..c9263c27 100644 --- a/app/src/free/java/com/stoutner/privacybrowser/BannerAd.java +++ b/app/src/free/java/com/stoutner/privacybrowser/BannerAd.java @@ -1,5 +1,5 @@ -/** - * Copyright 2016 Soren Stoutner . +/* + * Copyright © 2016-2017 Soren Stoutner . * * This file is part of Privacy Browser . * @@ -28,7 +28,7 @@ import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdSize; import com.google.android.gms.ads.AdView; -class BannerAd extends AppCompatActivity{ +public class BannerAd extends AppCompatActivity{ public static void requestAd(View view) { // Cast view to an AdView. AdView adView = (AdView) view; @@ -39,24 +39,24 @@ class BannerAd extends AppCompatActivity{ } public static void reloadAfterRotate (View view, Context applicationContext, String ad_id) { - // Cast view to an AdView. + // Cast `view` to an `AdView`. AdView adView = (AdView) view; // Save the layout parameters. RelativeLayout.LayoutParams adViewLayoutParameters = (RelativeLayout.LayoutParams) adView.getLayoutParams(); - // Remove the AdView. + // Remove the `AdView`. RelativeLayout adViewParentLayout = (RelativeLayout) adView.getParent(); adViewParentLayout.removeView(adView); - // Setup the new AdView. + // Setup the new `AdView`. adView = new AdView(applicationContext); adView.setAdSize(AdSize.SMART_BANNER); adView.setAdUnitId(ad_id); - adView.setId(R.id.adView); + adView.setId(R.id.adview); adView.setLayoutParams(adViewLayoutParameters); - // Display the new AdView. + // Display the new `AdView`. adViewParentLayout.addView(adView); // Request a new ad. @@ -65,7 +65,7 @@ class BannerAd extends AppCompatActivity{ } public static void hideAd(View view) { - // Cast view to an AdView. + // Cast `view` to an `AdView`. AdView adView = (AdView) view; // Hide the ad. @@ -73,26 +73,26 @@ class BannerAd extends AppCompatActivity{ } public static void showAd(View view) { - // Cast view to an AdView. + // Cast `view` to an `AdView`. AdView adView = (AdView) view; - // Hide the ad. + // Show the ad. adView.setVisibility(View.VISIBLE); } public static void pauseAd(View view) { - // Cast view to an AdView. + // Cast `view` to an `AdView`. AdView adView = (AdView) view; - // Pause the AdView. + // Pause the `AdView`. adView.pause(); } public static void resumeAd(View view) { - // Cast view to an AdView. + // Cast `view` to an `AdView`. AdView adView = (AdView) view; - // Resume the AdView. + // Resume the `AdView`. adView.resume(); } } \ No newline at end of file