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=cc9338171930c944da85a15997f10ba22c331678;hb=897b2d7f61a0492f228e3c172d7c6a76e3c5f3ac;hpb=bc6574b86391ed9c731835c18de7bd0a10de19f8 diff --git a/app/src/free/java/com/stoutner/privacybrowser/BannerAd.java b/app/src/free/java/com/stoutner/privacybrowser/BannerAd.java index cc933817..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,8 +28,8 @@ 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{ - static void requestAd(View view) { +public class BannerAd extends AppCompatActivity{ + public static void requestAd(View view) { // Cast view to an AdView. AdView adView = (AdView) view; @@ -38,25 +38,25 @@ class BannerAd extends AppCompatActivity{ adView.loadAd(adRequest); } - static void reloadAfterRotate (View view, Context applicationContext, String ad_id) { - // Cast view to an AdView. + public static void reloadAfterRotate (View view, Context applicationContext, String ad_id) { + // 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. @@ -64,35 +64,35 @@ class BannerAd extends AppCompatActivity{ adView.loadAd(adRequest); } - static void hideAd(View view) { - // Cast view to an AdView. + public static void hideAd(View view) { + // Cast `view` to an `AdView`. AdView adView = (AdView) view; // Hide the ad. adView.setVisibility(View.GONE); } - static void showAd(View view) { - // Cast view to an AdView. + public static void showAd(View view) { + // Cast `view` to an `AdView`. AdView adView = (AdView) view; - // Hide the ad. + // Show the ad. adView.setVisibility(View.VISIBLE); } - static void pauseAd(View view) { - // Cast view to an AdView. + public static void pauseAd(View view) { + // Cast `view` to an `AdView`. AdView adView = (AdView) view; - // Pause the AdView. + // Pause the `AdView`. adView.pause(); } - static void resumeAd(View view) { - // Cast view to an AdView. + public static void resumeAd(View view) { + // Cast `view` to an `AdView`. AdView adView = (AdView) view; - // Resume the AdView. + // Resume the `AdView`. adView.resume(); } } \ No newline at end of file