Add the xml under drawable
and set as a background to the popup layout like this
layoutOfPopup.setBackgroundResource(R.drawable.button_shape);
And set a size to the drawable xml
<size android:height="300dp" android:width="300dp"/>
and make the buttons size as WRAP_CONTENT or any fixed size
popRecord.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT));