Skip to content

Commit

Permalink
Merge pull request #713 from prebid/custom-rendering-delegate-size-ha…
Browse files Browse the repository at this point in the history
…ndling

Delegate size handling when custom renderer is active
  • Loading branch information
jsligh authored Nov 16, 2023
2 parents 7447a13 + 7b02e30 commit d1af151
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 d1af151

Please sign in to comment.