Overview
CometChatGroupsWithMessages
is a Composite Component encapsulating functionalities from the Groups and Messages components. Serving as a versatile wrapper, it seamlessly integrates with CometChatMessages, enabling users to open the module by clicking on any group within the list. This component inherits the behavior of Groups, fostering consistency and familiarity in user interactions.

Components | Description |
---|---|
Groups | The Groups component is designed to display a list of Groups . This essentially represents the recent conversation history. |
Messages | The Messages component is designed to manage the messaging interaction for Group's conversations. |
Usage
Integration
AsCometChatGroupsWithMessages
is a Composite Component, it can be effortlessly added directly in response to a button click or any event. Leveraging all the customizable properties and methods inherited from Groups, this component offers seamless integration and extensive customization capabilities. This makes it a versatile solution for enhancing user interaction within your application.
CometChatGroupsWithMessages
can be launched by adding the following code snippet into XML layout file.
Activity and Fragment
You can integrateCometChatGroupsWithMessages
into your Activity and Fragment by adding the following code snippets into the respective classes.
YourActivity.java
CometChatGroupsWithMessages
is the custom view class that you want to set as the content of your activity or the view for your fragment. This will display the CometChat groups with messages in your activity or fragment.
Actions
Actions dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs.1. onError
This action doesn’t change the behavior of the component but rather listens for any errors that occur in the Conversations component.Filters
Filters allow you to customize the data displayed in a list within a Component. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders of Chat SDK. While the GroupWithMessages component does not have filters, its components do, For more detail on individual filters of its component refer to Group FiltersEvents
Events are emitted by aComponent
. 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 CometChatGroupsWithMessages
does not produce any events but its component does.
Customization
To fit your app’s design requirements, you have the ability to customize the appearance of theCometChatGroupsWithMessages
component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.
Style
Using Style you can customize the look and feel of the component in your app, These parameters typically control elements such as the color, size, shape, and fonts used within the component. You can also customize its component styles. For more details on individual component styles, you can refer Groups Styles and Messages Styles. Styles can be applied to SubComponents using their respective configurations. Example Here we are changing the style of Groups and Messages component using GroupsConfiguration and MessageConfigurationFunctionality
These are a set of small functional customizations that allow you to fine-tune the overall experience of the component. With these, you can change text, set custom icons, and toggle the visibility of UI elements. CometChatGroupsWithMessages component does not have any available functionality. You can use Functional customisation its Components. For more details on individual component functionalities, you can refer Groups Functionalities and Messages functionalities.Advanced
For advanced-level customization, you can set custom views to the component. This lets you tailor each aspect of the component to fit your exact needs and application aesthetics. You can create and define your own views, layouts, and UI elements and then incorporate those into the component. CometChatGroupsWithMessages component does not have any advanced-level customization . You can use Advanced customisation its Components. For more details on individual component functionalities, you can refer Groups Advanced and Messages Advanced. CometChatGroupsWithMessages uses advanced-level customization of both Groups & Messages components to achieve its default behavior.- CometChatGroupsWithMessages utilizes the Itemclicklistener function of the
Groups
subcomponent to navigate the Groups to Messages

When you override
.setItemClickListener()
, the default behavior of CometChatGroupsWithMessages will also be overridden.- CometChatGroupsWithMessages utilizes the SetMenu function of the
Messages
subcomponent to navigatefrom Create Group to Details.

When you override
.setMenu()
, the default behavior of CometChatGroupsWithMessages will also be overridden.Configurations
Configurations offer the ability to customize the properties of each component within a Composite Component. CometChatGroupsWithMessages hasGroups
and Messages
component. Hence, each of these components will have its individual Configuration
. Configurations
expose properties that are available in its individual components.
Groups
You can customize the properties of the Groups component by making use of the GroupsConfiguration. You can accomplish this by employing the following method as demonstrated below:GroupsConfiguration
can be found under Groups. Properties marked with the 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Groups subcomponent
You can modify the style using the GroupsStyle
method.

Messages
You can customize the properties of the Messages component by making use of themessagesConfiguration
. You can accomplish this by employing the messagesConfiguration
as demonstrated below:
MessagesConfiguration
can be found under Messages. Properties marked with the 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Messages subcomponent and, in addition, you want to hide message composer.
You can modify the style using the messagesStyle
method and hide using hide(messageComposer: bool)
method.

Join Protected Group
You can customize the properties of the Join Group component by making use of the JoinGroupConfiguration. You can accomplish this by employing theJoinProtectedGroupConfiguration
class as demonstrated below:
JoinProtectedGroupConfiguration
can be found under Join Group. Properties marked with the report symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Join Group subcomponent.
You can modify the style using the JoinProtectedGroupStyle
property.

Create Group
You can customize the properties of the Create Group component by making use of the CreateGroupConfiguration. You can accomplish this by employing thecreateGroupConfiguration
props as demonstrated below:
CreateGroupConfiguration
can be found under Create Group. Properties marked with the 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Create Group subcomponent.
You can modify the style using the createGroupStyle
property.