From 7b02e30e81e575bb6dec256c43796a60022ffc59 Mon Sep 17 00:00:00 2001 From: Maxime Liege Date: Tue, 14 Nov 2023 17:53:17 +0100 Subject: [PATCH] Delegate size handling when custom rendering is active --- .../org/prebid/mobile/api/rendering/BannerView.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BannerView.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BannerView.java index dfd4355e8..242c9d238 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BannerView.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BannerView.java @@ -16,6 +16,8 @@ package org.prebid.mobile.api.rendering; +import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; + import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; @@ -629,9 +631,13 @@ private void displayPrebidView() { removeAllViews(); - final Pair sizePair = bidResponse.getWinningBidWidthHeightPairDips(getContext()); displayView = new DisplayView(getContext(), displayViewListener, displayVideoListener, adUnitConfig, bidResponse); - addView(displayView, sizePair.first, sizePair.second); + if (bidResponse.getPreferredPluginRendererName() == PrebidMobilePluginRegister.PREBID_MOBILE_RENDERER_NAME) { + final Pair sizePair = bidResponse.getWinningBidWidthHeightPairDips(getContext()); + addView(displayView, sizePair.first, sizePair.second); + } else { + addView(displayView, new FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)); + } } private void displayAdServerView(View view) {