How to customize the position of senderName, sentTime, and senderAvatar in message bubbles #92
AhyoungRyu
announced in
Conversation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Versions
Summary
This guide explains how to change the position and order of the sender name, sent time, and sender avatar in message bubbles.
Guide & Snippet
iOS
Header
Android
Layout Customization
Overview
You can customize the position and layout of message components by overriding the XML layout files in your application. Each message container has its own layout file that can be customized.
Layout Files
The SDK provides three main layout files for message containers:
aa_view_other_message.xml
: Layout for messages from other participants (LEFT container type)aa_view_my_message.xml
: Layout for messages from current user (RIGHT container type)aa_view_admin_message.xml
: Layout for admin/system messages (PLAIN container type)How to Override Layouts
Step 1: Create Layout Files in Your App
Create layout files with exactly the same name in your app's
res/layout/
directory:Step 2: Customize Layout Structure
You can modify the position, size, and arrangement of views in these layouts:
Important Requirements
1. Keep Required View IDs
All views must maintain their original IDs for SDK functionality:
ivProfile
: Profile image viewtvNickname
: Nickname text viewtvSentAt
: Sent time text viewcontentPanel
: Content containerstatusContainer
: Status container (MyMessage only)statusView
: Status view (MyMessage only)messageTemplateView
: Message template view (OtherMessage only)suggestedRepliesViewStub
: Suggested replies view stub (OtherMessage only)2. Don't Remove Views
Never remove views from the layout XML. If you want to hide a view, use the Container class methods to control visibility:
JS
Customizing the Layout and Components of Message Bubbles
This guide explains how to customize the position and appearance of elements like senderName, sentTime, and senderAvatar in message bubbles using the Sendbird AI Agent React SDK.
Customizing the Entire Layout (Custom Template)
You can fully control the arrangement and structure of message bubble elements by providing your own template to the existing layout system.
Step 1: Create a Custom Message Template
Step 2: Apply the Custom Template
Reference
No response
Screenshots
No response
Beta Was this translation helpful? Give feedback.
All reactions