Contacts

User contact can be selected in MirrorFly UIKit through the ContactActivity. Using the ContactListAdapter class, users can be selected and immediately moved to FlyChatActivity. By default, contact name and profile images are used to select the contact name and cover image.

Start an activity#

Use the intent to move from one activity to the ContactActivity.

Intent intent = ContactActivity.newIntent(context);
startActivity(intent);

If you want to customize the contact activity, use CustomContactActivity as follows refer Advance Section:

startActivity(ContactActivity.newIntentFromCustomActivity(context = requireContext(),"type"))

Contact Screen#

image_preview

StyleSet#

<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 Contact style theme. -->
<item name="mf_contact_preview_style">@style/Widget.MirrorFly.UserPreview</item>
<item name="mf_appbar_style">@style/Widget.MirrorFly.AppBar</item>
<item name="mf_recycler_view_style">@style/Widget.MirrorFly.RecyclerView</item>
</style>
<style name="Widget.MirrorFly.UserPreview">
<item name="android:background">@color/background_200</item>
<item name="mf_contact_preview_nickname_appearance">@style/MirrorFlyH2OnLight01</item>
</style>
</resources>

List of attributes of Widget.MirrorFly.UserPreview#

AttributeResource typeDescription
android:backgrounddrawable/colorThe user item background.
mf_user_preview_nickname_appearancetext appearanceSize, color, font, and style of the user nickname.

StringSet#

<string name="mf_text_header_contact">Contacts</string>
<string name="mf_text_user_list_empty">No contacts</string>
<string name="mf_text_error_get_user_list">Couldn\&#39;t retrieve contact list.</string>

IconSet#

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

Icon nameImageDescription
icon_arrow_leftBackGoes back to the previous page.