checkedChanges

Create a InitialValueFlow of checked state changes on the CompoundButton instance where the value emitted is whether the CompoundButton is currently checked.

Note: Created flow keeps a strong reference to the CompoundButton instance until the coroutine that launched the flow collector is cancelled.

Example of usage:

compoundButton.checkedChanges()
.onEach { isChecked ->
// handle isChecked
}
.launchIn(uiScope)

Create a InitialValueFlow of checked state change events on the RadioButton instance where the value emitted is the currently checked radio button id, or -1 when the selection is cleared.

Note: Created flow keeps a strong reference to the RadioButton instance until the coroutine that launched the flow collector is cancelled.

Example of usage:

radioGroup.checkedChanges()
.onEach { checkedId ->
// handle checkedId
}
.launchIn(uiScope)