public void resize(int w, int h, int offset_x, int offset_y, MRAIDImplementation.CUSTOM_CLOSE_POSITION custom_close_position, boolean allow_offscreen) {
DisplayMetrics metrics = new DisplayMetrics();
((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay().getMetrics(metrics);
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
this.getLayoutParams());
if (!implementation.resized) {
default_width = lp.width;
default_height = lp.height;
}
h = (int) (h * metrics.density + 0.5);
w = (int) (w * metrics.density + 0.5);
lp.height = h;
lp.width = w;
lp.gravity = Gravity.CENTER;
if (adView != null) {
adView.resize(w, h, offset_x, offset_y, custom_close_position, allow_offscreen, implementation);
}
if (adView != null) {
adView.interacted();
}
this.setLayoutParams(lp);
}