I have an Activity with a layout that includes an AdView with ads:adSize="SMART_BANNER". This sits at the bottom of the screen, below a custom WebView. Now, the WebView has content that is rendered based on the space (pixel dimensions) available to it. So before I render the WebView content I need to know what size (height in particular) the SMART_BANNER will be taking up, and what is therefore left for the WebView. From here it is stated that the smart banner can have a height that is any one of 32dp, 50dp and 90dp.
So far as I can understand, I need to wait for the format of the AdView to be decided before I can render the WebView. How can I do that? Maybe by setting an AdListener? However, the methods of AdListener only seem to allow me to determine e.g. when an ad has been loaded... I don't want to have to wait for the ad to be loaded, I only want to wait for the actual size of the ad to be allocated.
I know I can avoid all this by setting the AdView to BANNER, with a fixed height of 50dp, and this does indeed work fine. But I would prefer SMART_BANNER mainly because the height can shrink to 32dp in landscape mode on a small phone screen, leaving more room for actual content.