CometChatIncomingCall
is a Component that serves as a visual representation when the user receives an incoming call, such as a voice call or video call, providing options to answer or decline the call.
CometChatIncomingCall
being a custom component, offers versatility in its integration. It can be seamlessly launched via button clicks or any user-triggered action, enhancing the overall user experience and facilitating smoother interactions within the application.
Since CometChatIncomingCall
can be launched by adding the following code snippet into the XML layout file.
CometChatIncomingCall
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.
CometChatIncomingCall
into your Activity and Fragment by adding the following code snippets into the respective classes.
setOnAcceptCallClick
action is typically triggered when the user clicks on the accept button, initiating a predefined action. However, by implementing the following code snippet, you can easily customize or override this default behavior to suit your specific requirements.
SetOnDeclineCallClick
action is typically triggered when the user clicks on the reject button, initiating a predefined action. However, by implementing the following code snippet, you can easily customize or override this default behavior to suit your specific 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.
The CometChatIncomingCall
component does not have any exposed events.
IncomingCall
Component by applying the IncomingCallStyle
to it using the following code snippet.
Property | Description | Code |
---|---|---|
Background | Used to set the background color | .setBackground(@ColorInt int) |
Background | Used to set background gradient | .setBackground(Drawable) |
Border Width | Used to set border | .setBorderWidth(int) |
Corner Radius | Used to set border radius | .setCornerRadius(float) |
Border Color | Used to set border color | .setBorderColor(@ColorInt int) |
Title Appearance | Used to customise the appearance of the title | .setTitleAppearance(@StyleRes int) |
Subtitle Appearance | Used to customise the appearance of the subtitle | .setSubTitleAppearance(@StyleRes int) |
Avatar
component in the IncomingCall Component, you can use the following code snippet. For further insights on Avatar
Styles refer
Property | Description | Code |
---|---|---|
Accept Button Icon | Sets a custom accept button icon url for the incoming call screen. | .setAcceptButtonIcon(@DrawableRes int) |
Accept Button Text | Sets custom text for the accept button on the incoming call screen. | .setAcceptButtonText(String) |
Call | Sets the Call object for which the incoming call screen is displayed. Required for call actions. | .setCall(Call) |
Custom Sound For Calls | Defines the path for custom sound for calls on the incoming call screen. | .setCustomSoundForCalls(@RawRes int) |
Decline Button Icon | Sets a custom decline button icon for the incoming call screen. | .setDeclineButtonIcon(@DrawableRes int) |
Decline Button Text | Sets custom text for the decline button on the incoming call screen. | .setDeclineButtonText(String) |
Disable Sound For Call | Defines whether to disable sound for the call on the incoming call screen. | .disableSoundForCall(boolean) |
Set User | Sets the User object of the user who initiated the call on the incoming call screen. | .setUser(User) |
CometChatIncomingCall
component does not provide additional functionalities beyond this level of customization.