Recent Chats | MirrorFly Chat - Android UI Kit Docs

A Fly Recent chat is the complete list of recent chats that you're made with single conversation. The recent chat list is displayed once a connection with Mirrorfly server is established, and can be easily managed without complex implementation because the FlyRecentChatActivity or FlyRecentChatFragment class handles core features such as chat pagination and real-time updates.

Note : If search feature unavailable for your plan then it will not display in FlyRecentChatFragment.

Start an activity#

Use the intent to move from one activity to the FlyRecentChatActivity as follows:

val intent: Intent = FlyRecentChatActivity.newIntent(context)
startActivity(intent)

If you want to customize the recent chat activity, use CustomFlyRecentChatActivity as follows and Refer in advance Section for more details:

val intent: Intent = FlyRecentChatActivity.newIntentFromCustomActivity(context, CustomFlyRecentChatActivity::class.java)
startActivity(intent)
  • Recent chat view

flychat

  • Chat Type

flychat

Delete Chat#

Note : If Delete Chat feature unavailable for your plan then it will not display in the FlyRecentChatFragment.

To delete a recent chat of a user or a group they should long press the chat item.

delete_chat

StyleSet#

StyleSet is the list of styles provided by MirrorFly UIKit. Customizing the style of Recent Chat list items is straightforward: Simply inherit the MirrorFly UIKit-defined styles, then override the res/values/styles.xml or res/values/themes.xml file from the list below.

For example, the ChatPreview, AppBar, RecyclerView theme can be changed by overriding the Widget.MirrorFly.ChatPreview Widget.MirrorFly.AppBar Widget.MirrorFly.RecyclerView.

Listed below are all the Recent Chat style used in UIKit for Android. Styles can be changed by overwriting the res/values/styles.xml or res/values/themes.xml files with the same name.

<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.MFUIKITTest" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorAccent">@color/primary_300</item>
<item name="colorOnPrimary">@color/white</item>
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- UIKit Recent Chat style theme. -->
<item name="mf_chat_preview_style">@style/Widget.MirrorFly.ChatPreview</item>
<item name="mf_appbar_style">@style/Widget.MirrorFly.AppBar</item>
<item name="mf_recycler_view_style">@style/Widget.MirrorFly.RecyclerView</item>
</style>
<!-- Recent Chat ChatPreview theme. -->
<style name="Widget.MirrorFly.ChatPreview">
<item name="android:background">@drawable/selector_rectangle_light</item>
<item name="mf_chat_preview_title_appearance">@style/MirrorFlySubtitle1OnLight01</item>
<item name="mf_chat_preview_updated_at_appearance">@style/MirrorFlyCaption2OnLight02</item>
<item name="mf_chat_preview_unread_count_appearance">@style/MirrorFlyCaption1OnDark01</item>
<item name="mf_chat_preview_last_message_appearance">@style/MirrorFlyBody3OnLight03</item>
</style>
<!-- Recent Chat ChatPreview theme. -->
<!-- Recent Chat AppBar theme. -->
<style name="Widget.MirrorFly.AppBar">
<item name="android:background">@color/error_200</item>
<item name="mf_appbar_title_appearance">@style/MirrorFlyH2OnLight01</item>
<item name="mf_appbar_description_appearance">@style/MirrorFlyCaption2OnLight02</item>
<item name="mf_appbar_button_tint">@color/white</item>
<item name="mf_appbar_divider_color">@color/onlight_04</item>
<item name="mf_appbar_left_button_text_appearance">@style/MirrorFlyButtonPrimary300</item>
<item name="mf_appbar_left_button_text_color">@color/mf_button_uncontained_text_color_light</item>
<item name="mf_appbar_left_button_tint">@color/white</item>
<item name="mf_appbar_left_button_background">@drawable/mf_button_uncontained_background_light</item>
<item name="mf_appbar_right_button_text_appearance">@style/MirrorFlyButtonPrimary300</item>
<item name="mf_appbar_right_button_text_color">@color/mf_button_uncontained_text_color_light</item>
<item name="mf_appbar_right_button_tint">@color/white</item>
<item name="mf_appbar_right_button_background">@drawable/mf_button_uncontained_background_light</item>
</style>
<style name="MirrorFlyH2OnLight01">
<item name="android:fontFamily">sans-serif</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">16sp</item>
<item name="android:letterSpacing">-0.01</item>
<item name="android:lineSpacingExtra">4sp</item>
<item name="android:textColor">@color/white</item>
</style>
<!-- Recent Chat AppBar theme. -->
<!-- Recent Chat RecyclerView theme. -->
<style name="Widget.MirrorFly.RecyclerView">
<item name="android:background">@color/background_50</item>
<item name="mf_pager_recycler_view_use_divide_line">true</item>
<item name="mf_pager_recycler_view_divide_line_color">@color/onlight_04</item>
<item name="mf_pager_recycler_view_divide_line_height">@dimen/mf_size_1</item>
<item name="mf_pager_recycler_view_divide_margin_left">0dp</item>
<item name="mf_pager_recycler_view_divide_margin_right">0dp</item>
</style>
<!-- Recent Chat RecyclerView theme. -->
</resources>

List of attributes of Widget.MirrorFly.AppBar#

AppBar

AttributeResource typeDescription
android:backgrounddrawable/colorThe background of the header.
mf_appbar_title_appearancetext appearanceThe text size, color, font, and style of the header title.
mf_appbar_description_appearancetext appearanceThe text size, color, font, and style of the header description. The header description is used to show the typing indicator and the time of when a user has last seen.
mf_appbar_button_tintcolorThe color of the buttons.
mf_appbar_divider_colorcolorThe color of the line divider located at the bottom.
mf_appbar_left_button_text_appearancetext appearanceThe text size, color, font, and style of the left button.
mf_appbar_left_button_text_colorcolorThe text color of the left button.
mf_appbar_left_button_tintcolorThe color of the left button.
mf_appbar_left_button_backgrounddrawable/colorThe background of the left button.
mf_appbar_right_button_text_appearancetext appearanceThe text size, color, font, and style of the right button.
mf_appbar_right_button_text_colorcolorThe text color of the right button.
mf_appbar_right_button_tintcolorThe color of the right button.
mf_appbar_right_button_backgrounddrawable/colorThe background of the right button.
mf_appbar_search_button_icondrawableThe icon of the search button.
mf_appbar_search_cancel_button_icondrawableThe icon of the close search button.
mf_appbar_search_text_colorcolorThe text color of the search button.
mf_appbar_search_button_hinttextThe hint text of the search button.
mf_appbar_search_text_appearancetext appearanceThe text size, color, font, and style of the search text.

List of attributes of Widget.MirrorFly.RecyclerView#

RecyclerView

AttributeResource typeDescription
android:backgrounddrawable/colorThe background of the RecyclerView.
mf_pager_recycler_view_use_divide_linebooleanDetermines whether to use line dividers between messages.
mf_pager_recycler_view_divide_line_colorcolorThe color of the line divider.
mf_pager_recycler_view_divide_line_heightsizeThe height of the line divider.
mf_pager_recycler_view_divide_margin_leftsizeThe width of the empty space to the left of the line divider.
mf_pager_recycler_view_divide_margin_rightsizeThe width of the empty space to the right of the line divider.

List of attributes of Widget.MirrorFly.ChatPreview#

ChatPreview

AttributeResource typeDescription
android:backgrounddrawable/colorThe background of the ChatPreview.
mf_chat_preview_title_appearancetext appearanceThe size, color, font, and style of text of the chat name.
mf_chat_preview_updated_at_appearancetext appearanceThe size, color, font, and style of text of the number indicating the time the chat was last updated at.
mf_chat_preview_unread_count_appearancetext appearanceThe size, color, font, and style of text of the number indicating the number of unread messages.
mf_chat_preview_last_message_appearancetext appearanceThe size, color, font, and style of text of the last message sent in the chat.

StringSet#

Listed below are all the strings used in UIKit for Android. Strings can be changed by overwriting the res/values/strings.xml files with the same name.

<!-- Recent Chat List -->
<string name="mf_text_chat_list_title_unknown">(No name)</string>
<string name="mf_text_chat_list_unread_count">99+</string>
<string name="mf_text_chat_list_empty">No chats</string>
<string name="mf_text_select_contact_type">Contact Type</string>
<string name="mf_text_chat_anchor_delete_chat">Delete chat</string>

IconSet#

Listed below are all the icons used in UIKit for Android. Icons can be changed by overwriting the res/drawable files with the same name.

Icon nameImageDescription
icon_createAdd 2Select the chat type.
icon_arrow_leftBackGoes back to the previous page.
icon_chatBackAn icon of chat
ic_menu_deleteic_menu_deleteTo delete the chat
mf_shape_unread_message_count.xmlTo change unread count background : Light
mf_shape_unread_message_count_dark.xmlTo change unread count background : Dark