Open michalfita opened 12 months ago
Hi, and thanks for the report!
Indeed, it would be nice to unify the radio and check boxes.
I'm not against adding a label to the Checkbox to match what Radiobox has, but I'm wondering if we could be more general, and make it easier to attach an arbitrary TextView
(or anything else really) and have a nice highlighting over both. This way, we wouldn't have to support left vs right, various padding, ...
I don't mind. This, however, would breaking change.
The advantage of current one is much simpler creation. I did my PR trying to not break things, and this is working for me. At the moment I don't have capacity to do anything above that.
Is your feature request related to a problem? Please describe. Looks like the
CheckBox
is not a popular widget. I found it bizarre that contrary to radio box it's not linked with it's label (I have to makeLinearLayout
withTextView
on the right, but then highlighting for selection work only over check boxes, not the whole line.On top of that would be nice to have some kind of
MultichoiceGroup
control, returningHashSet<T>
orHashSet<Rc<T>>
with selections.Describe the solution you'd like
RadioGroup
does.Describe alternatives you've considered I brutally encoded bunch of
CheckBox
es withTextView
s linked by horizontalLinearLayout
, but it's not visually appealing on focus. Then I'd have to handle evens individually to maintain a state of possible selections.Additional context
I'm willing to provide PR if API of
CheckBox::new()
can be aligned withRadioBox::new()
, or a new builder::labelled()
can be introduced and we let both widgets be created w/o attached label, soRadioBox::new()
looses the argument andlabel
member becomesOptional<StyledString>
.