MessageHeader
is a Component that showcases the User or Group details in the toolbar. Furthermore, it also presents a typing indicator and a back navigation button for ease of use.
MessageHeader
component directly into the `layout.xml“ file.
MessageHeader
component does not have any exposed actions.
OnBackPressListener
is triggered when you press the back button in the app bar. It has a predefined behavior; when clicked, it navigates to the previous activity. However, you can override this action using the following code snippet.
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.
The MessageHeader
component does not have any exposed filters.
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 MessageHeader
component does not produce any events.
Property | Description | Code |
---|---|---|
User | Used to pass user object of which header specific details will be shown. This is a one of the required property for the component to function properly. | .setUser(user) |
Group | Used to pass group object of which header specific details will be shown. This is a one of the required property for the component to function properly. | .setGroup(Group) |
setBackButtonVisibility | Used to toggle back button visibility | .setBackButtonVisibility(View.GONE) |
setUserStatusVisibility | Used to toggle functionality to show user’s presence | .setUserStatusVisibility(View.VISIBLE) |
setVideoCallButtonVisibility | Defines whether a user can initiate a video call | .setVideoCallButtonVisibility(View.VISIBLE) |
setVoiceCallButtonVisibility | Defines whether a user can initiate a voice call | .setVoiceCallButtonVisibility(View.VISIBLE) |
time(long timestamp)
→ Custom full timestamp format
today(long timestamp)
→ Called when a message is from today
yesterday(long timestamp)
→ Called for yesterday’s messages
lastWeek(long timestamp)
→ Messages from the past week
otherDays(long timestamp)
→ Older messages
minute(long timestamp)
/ hour(long timestamp)
→ Exact time unit
minutes(long diffInMinutesFromNow, long timestamp)
→ e.g., “5 minutes ago”
hours(long diffInHourFromNow, long timestamp)
→ e.g., “2 hours ago”
subtitle_layout.xml
file and inflate it inside apply
function.
header_leading_view.xml
file, inflate it, and then pass it to the .setLeadingView(view)
method.