Class MessageComposerViewModelBinder
-
- All Implemented Interfaces:
public final class MessageComposerViewModelBinderA binder class responsible for binding the MessageComposerViewModel with the user interface components. It provides flexibility by allowing custom listeners for various message composer events.
-
-
Method Summary
Modifier and Type Method Description final MessageComposerViewModelBindermessageBuilder(Function0<Message> builder)Sets the message builder that is invoked when the send message button is clicked. final MessageComposerViewModelBinderonSendMessageButtonClick(Function1<Message, Unit> listener)Sets the click listener for the send message button. final MessageComposerViewModelBinderonTextInputChange(Function1<String, Unit> listener)Sets the text change listener that is invoked each time after text was changed. final MessageComposerViewModelBinderonAttachmentSelection(Function1<List<Attachment>, Unit> listener)Sets the selection listener that is invoked when attachments are selected. final MessageComposerViewModelBinderonAttachmentRemoval(Function1<Attachment, Unit> listener)Sets the click listener for the remove attachment button. final MessageComposerViewModelBinderonMentionSelection(Function1<User, Unit> listener)Sets the selection listener invoked when a mention suggestion item is selected. final MessageComposerViewModelBinderonCommandSelection(Function1<Command, Unit> listener)Sets the selection listener invoked when a command suggestion item is selected. final MessageComposerViewModelBinderonAlsoSendToChannelSelection(Function1<Boolean, Unit> listener)Sets the selection listener for the "also send to channel" checkbox. final MessageComposerViewModelBinderonDismissActionClick(Function0<Unit> listener)Sets the click listener for the dismiss action button. final MessageComposerViewModelBinderonCommandsButtonClick(Function0<Unit> listener)Sets the click listener for the pick commands button. final MessageComposerViewModelBinderonDismissSuggestions(Function0<Unit> listener)Sets the click listener invoked when suggestion popup is dismissed. final MessageComposerViewModelBinderonAudioRecordButtonHold(Function0<Unit> listener)Sets the hold listener invoked when the microphone button gets pressed down. final MessageComposerViewModelBinderonAudioRecordButtonLock(Function0<Unit> listener)Sets the lock listener invoked when the audio recording gets locked. final MessageComposerViewModelBinderonAudioRecordButtonCancel(Function0<Unit> listener)Sets the cancel listener invoked when the audio recording gets cancelled. final MessageComposerViewModelBinderonAudioRecordButtonRelease(Function0<Unit> listener)Sets the release listener invoked when the microphone button gets released. final MessageComposerViewModelBinderonAudioDeleteButtonClick(Function0<Unit> listener)Sets the click listener for the audio recording delete button. final MessageComposerViewModelBinderonAudioStopButtonClick(Function0<Unit> listener)Sets the click listener for the audio recording stop button. final MessageComposerViewModelBinderonAudioPlaybackButtonClick(Function0<Unit> listener)Sets the click listener for the audio recording playback button. final MessageComposerViewModelBinderonAudioCompleteButtonClick(Function0<Unit> listener)Sets the click listener for the audio recording complete button. final MessageComposerViewModelBinderonAudioSliderDragStart(Function1<Float, Unit> listener)Sets the drag start listener that is invoked when the audio slider starts being dragged. final MessageComposerViewModelBinderonAudioSliderDragStop(Function1<Float, Unit> listener)Sets the drag stop listener that is invoked when the audio slider stops being dragged. final Unitbind(MessageComposerView view, LifecycleOwner lifecycleOwner)final static MessageComposerViewModelBinderwith(MessageComposerViewModel vm)Creates a new instance of MessageComposerViewModelBinder with a given MessageComposerViewModel. -
-
Method Detail
-
messageBuilder
final MessageComposerViewModelBinder messageBuilder(Function0<Message> builder)
Sets the message builder that is invoked when the send message button is clicked.
-
onSendMessageButtonClick
final MessageComposerViewModelBinder onSendMessageButtonClick(Function1<Message, Unit> listener)
Sets the click listener for the send message button.
- Parameters:
listener- Click listener to be set.
-
onTextInputChange
final MessageComposerViewModelBinder onTextInputChange(Function1<String, Unit> listener)
Sets the text change listener that is invoked each time after text was changed.
- Parameters:
listener- Text change listener to be set.
-
onAttachmentSelection
final MessageComposerViewModelBinder onAttachmentSelection(Function1<List<Attachment>, Unit> listener)
Sets the selection listener that is invoked when attachments are selected.
- Parameters:
listener- Attachment selection listener to be set.
-
onAttachmentRemoval
final MessageComposerViewModelBinder onAttachmentRemoval(Function1<Attachment, Unit> listener)
Sets the click listener for the remove attachment button.
- Parameters:
listener- Attachment removal click listener to be set.
-
onMentionSelection
final MessageComposerViewModelBinder onMentionSelection(Function1<User, Unit> listener)
Sets the selection listener invoked when a mention suggestion item is selected.
- Parameters:
listener- Mention selection listener to be set.
-
onCommandSelection
final MessageComposerViewModelBinder onCommandSelection(Function1<Command, Unit> listener)
Sets the selection listener invoked when a command suggestion item is selected.
- Parameters:
listener- Command selection listener to be set.
-
onAlsoSendToChannelSelection
final MessageComposerViewModelBinder onAlsoSendToChannelSelection(Function1<Boolean, Unit> listener)
Sets the selection listener for the "also send to channel" checkbox.
- Parameters:
listener- Checkbox selection listener to be set.
-
onDismissActionClick
final MessageComposerViewModelBinder onDismissActionClick(Function0<Unit> listener)
Sets the click listener for the dismiss action button.
- Parameters:
listener- Dismiss action click listener to be set.
-
onCommandsButtonClick
final MessageComposerViewModelBinder onCommandsButtonClick(Function0<Unit> listener)
Sets the click listener for the pick commands button.
- Parameters:
listener- Pick commands click listener to be set.
-
onDismissSuggestions
final MessageComposerViewModelBinder onDismissSuggestions(Function0<Unit> listener)
Sets the click listener invoked when suggestion popup is dismissed.
- Parameters:
listener- Suggestion popup dismiss listener to be set.
-
onAudioRecordButtonHold
final MessageComposerViewModelBinder onAudioRecordButtonHold(Function0<Unit> listener)
Sets the hold listener invoked when the microphone button gets pressed down.
- Parameters:
listener- Microphone button hold listener to be set.
-
onAudioRecordButtonLock
final MessageComposerViewModelBinder onAudioRecordButtonLock(Function0<Unit> listener)
Sets the lock listener invoked when the audio recording gets locked.
- Parameters:
listener- Audio record lock listener to be set.
-
onAudioRecordButtonCancel
final MessageComposerViewModelBinder onAudioRecordButtonCancel(Function0<Unit> listener)
Sets the cancel listener invoked when the audio recording gets cancelled.
- Parameters:
listener- Audio record cancel listener to be set.
-
onAudioRecordButtonRelease
final MessageComposerViewModelBinder onAudioRecordButtonRelease(Function0<Unit> listener)
Sets the release listener invoked when the microphone button gets released.
- Parameters:
listener- Microphone button release listener to be set.
-
onAudioDeleteButtonClick
final MessageComposerViewModelBinder onAudioDeleteButtonClick(Function0<Unit> listener)
Sets the click listener for the audio recording delete button.
- Parameters:
listener- Audio recording delete button click listener to be set.
-
onAudioStopButtonClick
final MessageComposerViewModelBinder onAudioStopButtonClick(Function0<Unit> listener)
Sets the click listener for the audio recording stop button.
- Parameters:
listener- Audio recording stop button click listener to be set.
-
onAudioPlaybackButtonClick
final MessageComposerViewModelBinder onAudioPlaybackButtonClick(Function0<Unit> listener)
Sets the click listener for the audio recording playback button.
- Parameters:
listener- Audio recording playback button click listener to be set.
-
onAudioCompleteButtonClick
final MessageComposerViewModelBinder onAudioCompleteButtonClick(Function0<Unit> listener)
Sets the click listener for the audio recording complete button.
- Parameters:
listener- Audio recording complete button click listener to be set.
-
onAudioSliderDragStart
final MessageComposerViewModelBinder onAudioSliderDragStart(Function1<Float, Unit> listener)
Sets the drag start listener that is invoked when the audio slider starts being dragged.
- Parameters:
listener- Audio slider drag start listener to be set.
-
onAudioSliderDragStop
final MessageComposerViewModelBinder onAudioSliderDragStop(Function1<Float, Unit> listener)
Sets the drag stop listener that is invoked when the audio slider stops being dragged.
- Parameters:
listener- Audio slider drag stop listener to be set.
-
bind
final Unit bind(MessageComposerView view, LifecycleOwner lifecycleOwner)
-
with
final static MessageComposerViewModelBinder with(MessageComposerViewModel vm)
Creates a new instance of MessageComposerViewModelBinder with a given MessageComposerViewModel.
-
-
-
-