private fun createMaterialRadioButton(title: String): View {
val mRadioButton = MaterialRadioButton(requireContext())
mRadioButton.layoutParams = ViewGroup.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
mRadioButton.id = View.generateViewId()
mRadioButton.buttonTintList = ColorStateList.valueOf(ContextCompat.getColor(requireContext(), R.color.colorPrimary))
mRadioButton.text = title
mRadioButton.tag = title
mRadioButton.setTextColor(ContextCompat.getColor(requireContext(), R.color.colorPrimary))
mRadioButton.textSize = 28f
mRadioButton.layoutDirection = View.LAYOUT_DIRECTION_RTL
mRadioButton.gravity = Gravity.START and Gravity.CENTER_VERTICAL
mRadioButton.setPadding(0, 8, 0, 8)
mRadioButton.setOnClickListener(addOnClickRadioButtonListener(mRadioButton))
return mRadioButton
}
типа так но вместо радиобуттон чекбокс