Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upPrevious banner is invalidated before the next banner is fully loaded #171
Comments
This comment has been minimized.
This comment has been minimized.
jhansche
commented
Jun 4, 2015
|
I am able to work around this by extending public class MoPubView2 extends MoPubView {
private CustomEventBannerAdapter mDeferredBannerAdapter;
public MoPubView2(Context context) {
super(context);
}
public MoPubView2(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void loadCustomEvent(String customEventClassName, Map<String, String> serverExtras) {
if (mCustomEventBannerAdapter != null) {
// the super class will immediately invalidate the current banner,
// so instead let's override that and defer the invalidate until after the new banner is loaded.
mDeferredBannerAdapter = mCustomEventBannerAdapter;
mCustomEventBannerAdapter = null;
MoPubLog.v("Loading a new banner; invalidation of old banner will be deferred: " + mDeferredBannerAdapter);
}
super.loadCustomEvent(customEventClassName, serverExtras);
}
@Override
public void setAdContentView(View view) {
if (mDeferredBannerAdapter != null && !mDeferredBannerAdapter.isInvalidated()) {
MoPubLog.v("Deferred banner invalidation is happening now: " + mDeferredBannerAdapter);
mDeferredBannerAdapter.invalidate();
mDeferredBannerAdapter = null;
}
super.setAdContentView(view);
}
} |
This comment has been minimized.
This comment has been minimized.
jhansche
commented
Jun 5, 2015
|
I also ended up overriding |
This comment has been minimized.
This comment has been minimized.
jhansche
commented
Jun 5, 2015
|
Cross-posting the link from the developer forums: https://twittercommunity.com/t/previous-banner-is-invalidated-before-the-next-banner-starts-to-load/39484 |
wacamoe
added
the
archived_new_issue_process
label
Nov 29, 2018
wacamoe
closed this
Nov 29, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jhansche commentedJun 4, 2015
When a response is received to load a custom event banner, the previous banner is immediately invalidated before the next banner begins to request the next ad:
This results in a blank ad slot for the duration of the new banner's ad load.
I think instead, the old adapter's invalidate() method should be deferred until after the new banner adapter has completely loaded the next ad.