Chat UI
The chat UI is the chat page within the application, primarily composed of the message list and the input area. Global IM UIKit provides a default chat page Activity class and a chat page implemented based on the Fragment class.
- Activity-based: The default conversation list
ChatActivity
provided by Global IM UIKit. When the SDK needs to navigate to the conversation list internally, it will redirect to the default conversation list Activity. - Fragment-based: You can integrate the conversation list
ChatFragment
provided by Global IM UIKit into your application Activity, thus customizing the conversation list Activity. Note that you need to register the custom conversation list Activity with the Global IM UIKit SDK to replace the default conversation list Activity provided by Global IM UIKit.
Chat Interface
The chat interface generally consists of three parts: the navigation bar, the message list, and the input area.
Chat Page Structure
- ChatActivity: Provides a container for
ChatFragment
without specific implementation. - ChatFragment: Binds
ViewModel
and variouscomponents
within the page, and provides data source capabilities to the components. - ChatModule: Responsible for the UI display of
ChatFragment
and initializes the variouscomponents
on the current page. - ChatViewModel: Provides the data source for the conversation list page and interfaces for all operations.
Conversation List Page Components
- ChatHeaderComponent: Navigation component that displays the
connection status prompt
and amore
button. Global IM UIKit has default implementations forenable notifications
,search
, anddelete message
functionalities. - ChatSelectHeaderComponent: Multi-select mode component. Long-pressing a message and clicking
select
in the popup triggers the multi-select mode, displaying this component. - MessageListComponent: Message list component that displays all messages in chronological order. Long-pressing a message triggers a default popup. Global IM UIKit has default implementations for
reply
,forward
,copy
,delete
, andselect
functionalities. The message list view is created and customized inBaseMessageItemProvider
and the display templates for various message types. You can also use MessageListAdapter to customize each item in the list view. - InputPanelComponent: Message input component where users can input text, files, voice, images, videos, etc.
- MentionMemberComponent: Mention member component, used in group chats to display the current group's user list, triggered by entering @ in the message input component.
- ChatSelectBottomComponent: Multi-select mode component. Long-pressing a message and clicking
select
in the popup triggers the multi-select mode, displaying this component. - PageStatusComponent: Page status component displayed when the current conversation list has no data.