use of com.google.android.material.radiobutton.MaterialRadioButton in project collect by opendatakit.
the class LikertWidget method getRadioButton.
public RadioButton getRadioButton(int i) {
MaterialRadioButton button = new MaterialRadioButton(getContext());
button.setId(View.generateViewId());
button.setEnabled(!getFormEntryPrompt().isReadOnly());
button.setFocusable(!getFormEntryPrompt().isReadOnly());
radioButtonsParams.addRule(CENTER_HORIZONTAL, TRUE);
radioButtonsParams.setMargins(0, pxFromDp(getContext(), 16), 0, pxFromDp(getContext(), 8));
button.setLayoutParams(radioButtonsParams);
// Remove radio button padding - this needs minHeight/Width rather than padding
button.setMinHeight(0);
button.setMinWidth(0);
button.setMinimumHeight(0);
button.setMinimumWidth(0);
button.setGravity(Gravity.CENTER);
return button;
}
Aggregations