--
---
You received this message because you are subscribed to the Google Groups "PlayN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to playn+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
// Inside overridden setContentView
LinearLayout layout = new LinearLayout(this);
layout.setBackgroundColor(0xFF000000);
layout.setGravity(Gravity.TOP);
RelativeLayout innerLayout = new RelativeLayout(getBaseContext());
layout.addView(innerLayout);
_adViewer = new AdViewer(this); // Class that holds the ad stuff in a RelativeLayout container.
int adHeight = _adViewer.adSize().getHeightInPixels(this);
int gameHeight = getWindowManager().getDefaultDisplay().getHeight() - adHeight;
innerLayout.addView(_adViewer.container());
LayoutParams adLayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, adHeight);
adLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE);
_adViewer.container().setLayoutParams(adLayoutParams);
innerLayout.addView(view);
LayoutParams gameLayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, gameHeight);
gameLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
gameLayoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL, RelativeLayout.TRUE);
view.setLayoutParams(gameLayoutParams);
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
getWindow().setContentView(layout, params);
Thanks for the details. I'll post what I do for mine when its working. Going to try to finish up my early release this weekend.