First I am adding a layout programmatically then I set the height to this layout using adSize.getHeightInPixels() (SMART_BANNER). If I use only wrap_content for height then the layout will fill the entire screen (Because I add the layout programmatically.) At last I add the adView. Since the layout is fixed height then any banner (from mediation) larger than the SMART_BANNER height will be cut.
I am trying to find the best way to make this work without any problems.
I noticed that if I don't add the parent layout programmatically then I still have to set a fixed height to the layout because when the banner inside from the mediation is larger then, it will overlap my content instead of pushing it. Now I find that the best way is to set the height of the layout using the height of the mediation banners since I use only CustomEvents, this way the content will be pushed whenever a banner is taller. Is this what admob recommends?
In short way the options that i have are: banner cut, banner overlaps some of my content , banner push my content, or maybe layout set a maximum possible height and use only part of it, the rest is unused. (so if a network gives a 90dp banner and another network gives a 50dp banner then I always use 90dp for layout height)
Another question is related to creating and destroying programmatically a parent layout. Is it okay to create and destroy the parent layout containing the adView or should I just use setVisibility to GONE. I need this because I am using also my own custom mediation.
Thank you for your help,
Chris