Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced interstitial support #127

Merged
merged 12 commits into from
Aug 1, 2019

Conversation

yoalex5
Copy link
Collaborator

@yoalex5 yoalex5 commented Jul 8, 2019

GitHub issue

  1. A new constructor InterstitialAdUnit(String, int, int) was added
  2. Unit tests were added

API:

InterstitialAdUnit(@NonNull String configId, int minWidthPerc, int minHeightPerc)

Example:

AdUnit adUnit = new InterstitialAdUnit("1001-1", 50, 70);

OpenRTB request:

request.device.ext.prebid.interstitial: {"minwidthperc": 50, "minheightperc": 70}

TODO:

  1. Update the doc

@yoalex5 yoalex5 requested a review from anwzhang July 8, 2019 14:30
Copy link
Collaborator

@avohraa avohraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at the comments and consider having a look at it consequent changes in the unit tests as well.
Thanks.

try {
for (int i = 0; i < jsonArray.length(); i++) {
if (i != pos) {
jsonArray.put(jsonArray.get(i));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be result.put(jsonArray.get(i));

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

HashMap<String, Object> additionalMap = new HashMap<>(1);
additionalMap.put(RequestParams.INSTL_MIN_SIZE_PERC_KEY, minSizePerc);

RequestParams requestParams = new RequestParams(configId, adType, sizes, keywords, additionalMap);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need an additionalMap for passing the minSizePerc when currently we have only one object to pass to the RequestParams? This HashMap is certainly introducing overheads as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extensibility. I would like to eliminate passing a lot of optional arguments into constructor because it creates unnecessary state and makes initializing process overhead. I am sure that the RequestParams class will be extended in a future by adding new features

By the way, I have a plan to improve this logic soon and provide you a PR

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @yoalex5,

I am not in support of having HashMap for just one parameter. But yes, you can create a PR for refactoring the RequestParams as a whole and maybe have all the parameters attached to the HashMap. Or you can come up with a better approach.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avohraa, are you going to approve this PR or you are waiting for changes from my side ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still waiting for your changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay. I will do

Integer minSizePercWidth = null;
Integer minSizePercHeight = null;

Map<String, Object> additionalMap = requestParams.getAdditionalMap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing an instance of AdSize eliminates this processing overhead.

@bszekely1 bszekely1 added this to the Prebid SDK 1.2 milestone Jul 24, 2019
@yoalex5
Copy link
Collaborator Author

yoalex5 commented Jul 30, 2019

@avohraa, could you please review the latest changes

@yoalex5 yoalex5 requested a review from avohraa July 30, 2019 14:15
@yoalex5
Copy link
Collaborator Author

yoalex5 commented Jul 31, 2019

@anwzhang, @avohraa, could you please review

…ial_advanced2

# Conflicts:
#	PrebidMobile/API1.0/src/test/java/org/prebid/mobile/PrebidServerAdapterTest.java
#	PrebidMobile/API1.0/src/test/java/org/prebid/mobile/UtilTest.java
@yoalex5
Copy link
Collaborator Author

yoalex5 commented Jul 31, 2019

@avohraa, I have merged the master into current branch. Could you please review it?
Thanks

Copy link
Collaborator

@avohraa avohraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This looks good to me.

@yoalex5 yoalex5 merged commit e5094e9 into prebid:master Aug 1, 2019
@yoalex5 yoalex5 linked an issue Oct 28, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Advanced interstitial support
4 participants