Base Components | Description |
---|---|
MessageInput | This provides a basic layout for the contents of this component, such as the TextField and buttons |
ActionSheet | The ActionSheet component presents a list of options in either a list or grid mode, depending on the user’s preference |
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.
setStyle
method.
Property | Description | Code |
---|---|---|
Set BorderWidth | Used to set outermost border | .setBorderWidth(int) |
Border Color | Used to set border color | .setBorderColor(@ColorInt int) |
Corner Radius | Used to set corner radius | .setCornerRadius(int) |
Background | This method will set the background color for message list | .setBackground(@ColorInt int) |
Set InputBackgroundColor | Used to set input background color | .setInputBackgroundColor(@ColorInt int) |
Set TextAppearance | Used to set input text style | .setTextAppearance(@StyleRes int) |
Set PlaceHolderTextColor | Used to set placeholder text color | .setPlaceHolderTextColor(@StyleRes int) |
Background | This will set drawable component for list background | .setBackground(@drawable int) |
Set AttachIconTint | Used to set attachment icon tint | .setAttachIconTint(@ColorRes int) |
Set SendIconTint | Used to set send button icon tint | .setSendIconTint(@ColorRes int) |
Set SeparatorTint | Used to set separator color | .setSeparatorTint(@ColorRes int) |
Set VoiceRecordingIconTint | used to set voice recording icon color | .setVoiceRecordingIconTint(@ColorRes int) |
.setMessageInputStyle()
method. For more details, please refer to MessageInput styles.
.setMediaRecorderStyle()
method. For more details, please refer to MediaRecorder styles.
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) |
Set PlaceHolderText | Used to set composer’s placeholder text | .setPlaceHolderText("Your_Text") |
Disable TypingEvents | Used to disable/enable typing events , default false | .disableTypingEvents(boolean) |
Disable SoundForMessages | Used to toggle sound for outgoing messages | .disableSoundForMessages(boolean) |
Set SendButtonIcon | Used to set send button icon | .setSendButtonIcon(@DrawableRes int) |
Set Text | Used to set predefined text | .setText("Your_Text") |
Set MaxLine | Maximum lines allowed to increase in the input field | .setMaxLine(int) |
Set VoiceRecordingIcon | Sets custom drawable resources for the record buttons. | .setVoiceRecordingIcon(@DrawableRes int) |
Set VoiceRecordingVisibility | The visibility constant for the voice recording view. Use View.VISIBLE, View.INVISIBLE or View.GONE. | .setVoiceRecordingVisibility(int) |
Set PauseIcon | Sets custom drawable resources for the pause buttons. | .setPauseIcon(@DrawableRes int) |
Set PlayIcon | Sets custom drawable resources for the play buttons. | .setPlayIcon(@DrawableRes int) |
Set DeleteIcon | Sets custom drawable resources for the delete buttons. | .setDeleteIcon(@DrawableRes int) |
Set StopIcon | Sets custom drawable resources for the stop buttons. | .setStopIcon(@DrawableRes int) |
Set AuxiliaryButtonAlignment | controls position auxiliary button view , can be left or right . default right | .setAuxiliaryButtonAlignment(AuxiliaryButtonsAlignment) |
Set AttachmentIcon | sets the icon to show in the attachment button | .setAttachmentIcon(@DrawableRes int) |
Hide LiveReaction | used to toggle visibility for live reaction component | .hideLiveReaction(boolean) |
Disable Mentions | 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); |
Set CustomSoundForMessages | Used to give custom sounds to outgoing messages | .setCustomSoundForMessages(String) |
Set LiveReactionIcon | used to set custom live reaction icon. | .setLiveReactionIcon(@DrawableRes int) |
setAttachmentOptions()
, you can set a list of custom MessageComposerActions
for the MessageComposer Component. This will override the existing list of MessageComposerActions
.
.setAuxiliaryButtonView()
function.
.setSecondaryButtonView()
function.
.setHeaderView()
method.
.setFooterView()
method.