// RadioButton
int width = new RadioButton(getContext()).getButtonDrawable().getIntrinsicWidth();
int height = new RadioButton(getContext()).getButtonDrawable().getIntrinsicHeight();
// CheckBox
int width = new CheckBox(getContext()).getButtonDrawable().getIntrinsicWidth();
int height = new CheckBox(getContext()).getButtonDrawable().getIntrinsicHeight();
For the record, because the function needs to be rewritten, the comments are too messy, so I will delete them. . .
But I am afraid that I will forget it, and I may use it again in the future. . .