Skip to content

Commit

Permalink
Delegate size handling when custom rendering is active
Browse files Browse the repository at this point in the history
  • Loading branch information
github-maxime-liege committed Nov 14, 2023
1 parent 45dd765 commit 70c8a7a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -629,9 +631,13 @@ private void displayPrebidView() {

removeAllViews();

final Pair<Integer, Integer> 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<Integer, Integer> 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) {
Expand Down

0 comments on commit 70c8a7a

Please sign in to comment.