I have created a Custom AlertDialog like this -
remark_builder = new AlertDialog.Builder(this);
// Get the layout inflater
LayoutInflater inflater = this.getLayoutInflater();
// Inflate and set the layout for the dialog
// Pass null as the parent view because its going in the
// dialog layout
remark_builder.setCancelable(true);
final View dialogView = inflater.inflate(R.layout.add_remark_dialog, null);
remark_builder.setView(dialogView);
if (remark_dialog == null || !remark_dialog.isShowing()) {
remark_dialog = remark_builder.create();
remark_dialog.setCanceledOnTouchOutside(false);
remark_dialog.show();
}
I want to add margins to the left and right of this alertdialog.
I have tried a lot of code over the internet but it is emphasizing on setting the width and height of the Alert Dialog. I don't want to set the width and height. I want to add margins to the left and right of the AlertDialog which is MATCH_PARENT.
My current alert dialog looks like :
I want to add margins like 40 or 50 or according to the device density. is this possible?