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
is comprised of the following components:
Components | Description |
---|---|
ListItem Component | This component’s view consists of avatar, status indicator , title, and subtitle. The fields are then mapped with the SDK’s user, group class. |
Back Button | BackButton that allows users to navigate back from the current activity or screen to the previous one |
MessageHeader
component directly into the `layout.xml“ file.
MessageHeader
component does not have any exposed actions.
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.
MessageHeaderStyle
object to the MessageHeader
component.
MessageHeaderStyle
are as follows:
Property | Description | Code |
---|---|---|
Border Width | Used to set border | .setBorderWidth(int) |
Border Color | Used to set border color | .setBorderColor(@ColorInt int) |
Corner Radius | Used to set corner radius | .setCornerRadius(float) |
Background | Used to set background colour | .setBackground(@ColorInt int) |
Background | Used to set Drawable in background | .setBackground(@Drawable ) |
BackIcon Tint | Used to set back button icon tint | .setBackIconTint(@ColorInt int) |
TypingIndicator TextAppearance | Used to set typing indicator textStyle | .setTypingIndicatorTextAppearance(@StyleRes int) |
TypingIndicator TextColor | Used to set typing indicator text color | .setTypingIndicatorTextColor(@ColorInt int) |
SubtitleText Appearance | Used to set subtitle text style | .setSubtitleTextAppearance(@StyleRes int) |
SubtitleText Color | Used to set subtitle text color | .setSubtitleTextColor(@ColorInt int) |
OnlineStatus Color | Used to set online status colour | .setOnlineStatusColor(@ColorInt int) |
Avatar
component within the MessageHeader
Component, you can use the following code snippet. For more information you can refer Avatar Styles.
ListItemStyle
component within the MessageHeader
Component, you can use the following code snippet. For more information, you can refer ListItem Styles.
Status Indicator
component within the MessageHeader
Component, you can use the following code snippet. For more information you can refer StatusIndicator Styles.
Property | Description | Code |
---|---|---|
User | Used to pass user object of which header specific details will be shown | .setUser(user) |
Group | Used to pass group object of which header specific details will be shown | .setGroup(Group) |
ProtectedGroupIcon | Used to set custom protected group icon | .setProtectedGroupIcon(@DrawableRes int) |
PrivateGroupIcon | Used to set custom private group icon | .setPrivateGroupIcon(@DrawableRes int) |
Hide BackIcon | Used to toggle back button visibility | .hideBackIcon(boolean) |
Disable Typing | Used to enable /disable typing indicators | .disableTyping(boolean) |
Disable UsersPresence | Used to toggle functionality to show user’s presence | .disableUsersPresence(boolean) |
MessageHeader
component consists of a ListItemView
. You can customize the ListItem according to your requirements by using the .setListItemView
method.
custom_header_item.xml
as a custom layout file. This file can then be inflated and passed to setListItemView()
method.
.setSubtitleView
method, you can modify the SubtitleView to meet your specific needs.
subtitle_layout.xml
file and inflate it inside apply
function.
.setBackIcon()
method.
custom_header_back_icon.xml
file, inflate it, and then pass it to the .setBackIcon(view)
method.
.setMenu()
method.
view_menu.xml
file, inflate it, and then return it from .setBackIcon(view)
method.