I have a GLSurfaceView that covers the whole screen and added an admob ad. The problem is that a part of the surface view is now covered by the ad which is not good since the user will not be able to use some controls. What I want is when an ad is active the surface view to be initialized with less that the full height of screen, namely minus the admob ad height.
Whatever I tried be it RelativeLayout or linear layout in another linear layout what I get is that the ad moves my surface view out of the view while the surface view still has the screen height.
You can try to use layout_weight for glsurfaceview, like
layout_height="0dp" and layout_weight="1".Android will automatically calculate the height for your glsurfaceview.