void expand(int w, int h, boolean custom_close,
final MRAIDImplementation caller,
AdWebView.MRAIDFullscreenListener listener) {
MRAIDChangeSize(w, h);
close_button = ViewUtil.createCloseButton(this.getContext(), custom_close);
FrameLayout.LayoutParams blp = (LayoutParams) close_button.getLayoutParams();
if (!caller.owner.isFullScreen) {
if (getChildAt(0) != null) {
blp.rightMargin = (this.getMeasuredWidth()
- this.getChildAt(0).getMeasuredWidth()) / 2;
}
}
close_button.setLayoutParams(blp);
close_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
caller.close();
}
});
if (caller.owner.isFullScreen) {
mraidFullscreenExpand(caller, custom_close, listener);
} else {
this.addView(close_button);
}
isMRAIDExpanded = true;
}