3

I've got a programmatically-created layout, where when my app gets ads, it'll show an admob view, pushing my existing GLView down and resizing it.

However, although it initially seems to be pushing my GLView down, the GLView suddenly resets itself and overlaps the AdMob view and resets itself to its original size.

This is what I do to resize and reposition the GLSurfaceView:

Main.Instance.admobView.setVisibility(View.VISIBLE);

RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(Main.Instance.GLView.getWidth(),
    Main.Instance.GLView.getHeight() - AdSize.BANNER.getHeight());
params.topMargin = AdSize.BANNER.getHeight();

Main.Instance.GLView.setLayoutParams(params);

Main.Instance.TopView.requestLayout();

This is what I get in the end:

https://i.stack.imgur.com/UuwKA.png

Does anyone have any idea what could be causing this?

0 Answers0