From da98947dab4f3ae51c043d322573147ebe80ff4d Mon Sep 17 00:00:00 2001 From: serso Date: Wed, 2 Aug 2017 11:29:12 +0200 Subject: [PATCH] Use SMART_BANNER in Admob --- .../java/org/solovyev/android/calculator/AdView.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/AdView.java b/app/src/main/java/org/solovyev/android/calculator/AdView.java index 7d769cb1..bfc3134e 100644 --- a/app/src/main/java/org/solovyev/android/calculator/AdView.java +++ b/app/src/main/java/org/solovyev/android/calculator/AdView.java @@ -1,10 +1,14 @@ package org.solovyev.android.calculator; +import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; +import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; + import android.content.Context; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; import android.widget.FrameLayout; + import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdSize; @@ -12,9 +16,6 @@ import com.google.android.gms.ads.AdSize; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; -import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; - public class AdView extends FrameLayout { @Nullable @@ -92,7 +93,7 @@ public class AdView extends FrameLayout { private com.google.android.gms.ads.AdView addAdmobView() { final com.google.android.gms.ads.AdView v = new com.google.android.gms.ads.AdView(getContext()); v.setVisibility(GONE); - v.setAdSize(AdSize.BANNER); + v.setAdSize(AdSize.SMART_BANNER); v.setAdUnitId(getResources().getString(R.string.admob)); final LayoutParams lp = new LayoutParams(MATCH_PARENT, WRAP_CONTENT); lp.gravity = Gravity.CENTER;