layout.xml
file.
onCreate
state of the activity.OnSendButtonClick
event gets activated when the send message button is clicked. It has a predefined function of sending messages entered in the composer EditText
. However, you can overide this action with the following code snippet.
Component
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
The MessageComposer Component does not emit any events of its own.
Property | Description | Code |
---|---|---|
User | Used to pass user object of which header specific details will be shown | .setUser(user) |
Group | Used to pass group object of which header specific details will be shown | .setGroup(Group) |
disableTypingEvents | Used to disable/enable typing events , default false | .disableTypingEvents(boolean) |
disableSoundForMessages | Used to toggle sound for outgoing messages | .disableSoundForMessages(boolean) |
setInitialComposerText | Used to set predefined text | .setInitialComposerText("Your_Text") |
setMaxLine | Maximum lines allowed to increase in the input field | .setMaxLine(int) |
setAuxiliaryButtonAlignment | controls position auxiliary button view , can be left or right . default right | .setAuxiliaryButtonAlignment(AuxiliaryButtonsAlignment) |
setDisableMentions | Sets whether mentions in text should be disabled. Processes the text formatters If there are text formatters available and the disableMentions flag is set to true, it removes any formatters that are instances of CometChatMentionsFormatter. | .setDisableMentions(true); |
setCustomSoundForMessages | Used to give custom sounds to outgoing messages | .setCustomSoundForMessages(String) |
setAttachmentButtonVisibility | Hides the attachment button in the composer | .setAttachmentButtonVisibility(View.VISIBLE) |
setStickersButtonVisibility | Hides the stickers button in the composer | .setStickersButtonVisibility(View.GONE) |
setSendButtonVisibility | Hides the send button in the composer | .setSendButtonVisibility(View.VISIBLE) |
setCameraAttachmentOptionVisibility | Controls whether camera attachments are allowed | .setCameraAttachmentOptionVisibility(View.VISIBLE) |
setImageAttachmentOptionVisibility | Controls whether image attachments are allowed | .setImageAttachmentOptionVisibility(View.VISIBLE) |
setVideoAttachmentOptionVisibility | Controls whether video attachments are allowed | .setVideoAttachmentOptionVisibility(View.VISIBLE) |
setAudioAttachmentOptionVisibility | Controls whether audio attachments are allowed | .setAudioAttachmentOptionVisibility(View.VISIBLE) |
setFileAttachmentOptionVisibility | Controls whether file attachments are allowed | .setFileAttachmentOptionVisibility(View.VISIBLE) |
setPollAttachmentOptionVisibility | Controls whether polls can be shared | .setPollAttachmentOptionVisibility(View.VISIBLE) |
setCollaborativeDocumentOptionVisibility | Controls whether collaborative documents can be shared | .setCollaborativeDocumentOptionVisibility(View.VISIBLE) |
setCollaborativeWhiteboardOptionVisibility | Controls whether collaborative whiteboards can be shared | .setCollaborativeWhiteboardOptionVisibility(View.VISIBLE) |
setAttachmentOptions()
, you can set a list of custom MessageComposerActions
for the MessageComposer Component. This will override the existing list of MessageComposerActions
.
.setAuxiliaryButtonView()
function.
.setHeaderView()
method.