I want to add left and right margin to android alert dialog on both sides lets say 15 percent of the screen width, this is my code so far, how may i do it?
AlertDialog.Builder alert = new AlertDialog.Builder(context);
WebView wv = new WebView(context);
wv.setBackgroundColor(getResources().getColor(android.R.color.transparent));
wv.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
wv.loadUrl(ANY_URL_STRING);
alert.setView(wv);
alert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
alert.show();