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.
Use the intent to move from one activity to the ContactActivity.
If you want to use the ContactActivity for a specific chat type, refer to the following sample code.
Note : The CreatableContactType consists of Normal and Group types.
If you want to customize the contact activity, use CustomContactActivity as follows:
UIKit’s ContactFragment class extends the Fragment class and is designed to take up the whole screen of the activity. It is recommended to create this fragment in the onCreate() method of the user-generated activity. By default, the header of the create a chat view isn’t visible when using the ContactFragment.
UIKit provides methods that can be overridden so that you can customize your UI.
|createCreateContactFragment()||ContactFragment||Called when the ContactActivity is created.|
To customize the style of contact items, change the UIKit-defined style values in the res/values/themes.xml file. The table below shows the style of contact items you can customize. You need to keep the original names of the items and parents defined by the UIKit during the process.
|android:background||drawable/color||The user item background.|
|mf_user_preview_nickname_appearance||text appearance||Size, color, font, and style of the user nickname.|
To apply the declared custom styles, pass the R.style.Custom to the ContactFragment.Builder as follows: