CometChatCallButtons
is a Component provides users with the ability to make calls, access call-related functionalities, and control call settings. Clicking this button typically triggers the call to be placed to the desired recipient.
CometChatCallButtons
can be used inside another widget or can be launched to a new screen by adding the following code snippet into the XML layout file.
CometChatCallButtons
within the XML code or in your activity or fragment then you’ll need to extract them and set them on the User object using the appropriate method.
setOnVoiceCallClick
action is usually invoked when a voice call is initiated, executing predefined actions. However, by utilizing the provided code snippet, you can effortlessly tailor or override this default behavior to suit your unique requirements.
setOnVideoCallClick
action is typically triggered when a video call is initiated, executing default actions. However, with the provided code snippet, you have the flexibility to easily customize or override this default behavior according to your specific preferences or requirements.
setOnError
and improve error handling.
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.
Events emitted by the Call buttons component are as follows.
Event | Description |
---|---|
ccCallAccepted | Triggers when the outgoing call is accepted. |
ccCallRejected | Triggers when the outgoing call is rejected. |
CometChatCallEvents
CometChatCallEvents
CometChatCallButtons
Component by applying the CallButtonsStyle
to it using the following code snippet.
CallButtonsStyle
Property | Description | Code |
---|---|---|
Background | Used to set the background color | .setBackground(@ColorInt int) |
Background | Used to set background Drawable | .setBackground(Drawable) |
Border Color | Used to set border color | .setBorderColor(@ColorInt int) |
Border Width | Used to set border | .setBorderWidth(int) |
Corner Radius | Used to set border radius | .setCornerRadius(float) |
Property | Description | Code |
---|---|---|
Group | Used to set Group object to the call button | .set(Group: Group) |
Hide Video Call | Used to hide video call button | .set(HideVideoCall: boolean) |
Hide Voice Call | Used to hide voice call button | .set(HideVoiceCall: boolean) |
User | Used to set User object to the call button | .set(User: User) |
Video Call Icon | Used to set video call icon | .set(VideoCallIcon: @DrawableRes int) |
Video Call Text | Used to set video call text | .set(VideoButtonText: String) |
Voice Call Icon | Used to set voice call icon | .set(VoiceCallIcon: @DrawableRes int) |
Voice Call Text | Used to set voice call text | .set(VoiceButtonText: String) |
CometChatCallButtons
component does not provide additional functionalities beyond this level of customization.
Configurations
expose properties that are available in its individual components.OutgoingCallConfiguration
. You can accomplish this by employing the OutgoingCallConfiguration
as demonstrated below:
OutgoingCallConfiguration
can be found under Outgoing Call. Properties marked with the 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Outgoing Call subcomponent and, in addition, you only want to disable soundForCalls.
You can modify the style using the OutgoingCallStyle
property, and disable sound for calls using .disable(soundForCalls: bool)
property.