Skip to content

Commit 3c116e1

Browse files
forezacopybara-github
authored andcommitted
Updated Banner Snippets and examples to use the Large Anchored Adaptive AdSize.
PiperOrigin-RevId: 869817551
1 parent 981f415 commit 3c116e1

File tree

5 files changed

+10
-10
lines changed
  • java/admob/BannerExample/app/src/main/java/com/google/android/gms/example/bannerexample
  • kotlin
    • admanager/BannerExample/app/src/main/kotlin/com/google/android/gms/example/bannerexample
    • admob/BannerExample/app/src/main/java/com/google/android/gms/example/bannerexample
    • advanced/JetpackComposeDemo/app/src/main/java/com/google/android/gms/example/jetpackcomposedemo/formats

5 files changed

+10
-10
lines changed

java/admob/BannerExample/app/src/main/java/com/google/android/gms/example/bannerexample/MyActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ private void loadBanner() {
178178
adView = new AdView(this);
179179
adView.setAdUnitId(AD_UNIT_ID);
180180
// [START set_ad_size]
181-
// Request an anchored adaptive banner with a width of 360.
182-
adView.setAdSize(AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(this, 360));
181+
// Request a large anchored adaptive banner with a width of 360.
182+
adView.setAdSize(AdSize.getLargeAnchoredAdaptiveBannerAdSize(this, 360));
183183
// [END set_ad_size]
184184

185185
// Replace ad container with new ad view.

kotlin/admanager/BannerExample/app/src/main/kotlin/com/google/android/gms/example/bannerexample/MyActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ class MyActivity : AppCompatActivity() {
146146
val adView = AdManagerAdView(this)
147147
adView.adUnitId = AD_UNIT_ID
148148
// [START set_ad_size]
149-
// Request an anchored adaptive banner with a width of 360.
150-
adView.setAdSize(AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(this, 360))
149+
// Request a large anchored adaptive banner with a width of 360.
150+
adView.setAdSize(AdSize.getLargeAnchoredAdaptiveBannerAdSize(this, 360))
151151
// [END set_ad_size]
152152
this.adView = adView
153153

kotlin/admob/BannerExample/app/src/main/java/com/google/android/gms/example/bannerexample/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ class MainActivity : AppCompatActivity() {
148148
val adView = AdView(this)
149149
adView.adUnitId = AD_UNIT_ID
150150
// [START set_ad_size]
151-
// Request an anchored adaptive banner with a width of 360.
152-
adView.setAdSize(AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(this, 360))
151+
// Request a large anchored adaptive banner with a width of 360.
152+
adView.setAdSize(AdSize.getLargeAnchoredAdaptiveBannerAdSize(this, 360))
153153
// [END set_ad_size]
154154
this.adView = adView
155155

kotlin/advanced/JetpackComposeDemo/app/src/main/java/com/google/android/gms/example/jetpackcomposedemo/formats/AdManagerBannerScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ fun AdManagerBannerScreen(modifier: Modifier = Modifier) {
5252
adView.adUnitId = ADMANAGER_ADAPTIVE_BANNER_AD_UNIT_ID
5353

5454
// [START set_ad_size]
55-
// Set the adaptive banner ad size with a given width.
56-
val adSize = AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(LocalContext.current, 360)
55+
// Set a large anchored adaptive banner ad size with a given width.
56+
val adSize = AdSize.getLargeAnchoredAdaptiveBannerAdSize(LocalContext.current, 360)
5757
adView.setAdSize(adSize)
5858
// [END set_ad_size]
5959

kotlin/advanced/JetpackComposeDemo/app/src/main/java/com/google/android/gms/example/jetpackcomposedemo/formats/BannerScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ fun BannerScreen(modifier: Modifier = Modifier) {
5252
adView.adUnitId = BANNER_AD_UNIT_ID
5353

5454
// [START set_ad_size]
55-
// Set the adaptive banner ad size with a given width.
56-
val adSize = AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(LocalContext.current, 360)
55+
// Set a large anchored adaptive banner ad size with a given width.
56+
val adSize = AdSize.getLargeAnchoredAdaptiveBannerAdSize(LocalContext.current, 360)
5757
adView.setAdSize(adSize)
5858
// [END set_ad_size]
5959

0 commit comments

Comments
 (0)