Group profiles

Group profiles consist of several components, among them avatar and cover images. They also provide some functionality for editing them. When you create a group chat (see Public group chats) it will initially contain a simple profile consisting on a name and a placeholder avatar.

Next we will explain how to display groups profiles and how to edit them.

User profiles in the chat list

Group profiles are displayed directly from the chat list. If you have not implemented your chat list yet, please refer to the Displaying chats section for instructions on how to do this.

To display user profiles from the ChatListFragment you must implement the OnProfileAvatarClickListener on the same Activity in which the ChatListFragment has been previously implemented:

public class ChatListActivity extends AppCompatActivity 
                               implements OnProfileAvatarClickListener {
                                       
	@Override
	protected void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    
	    // The ChatListFragment initialisation goes here...
	    
	    chatListFragment.setOnProfileAvatarClickListener(this);
	}
	
	...
	
}

Next, you must override the onProfileAvatarClick method as shown here:

@Override
public boolean onProfileAvatarClick(@NonNull String chatId) {
    return true;
}

It is important to notice that the overridden method has a Boolean type return value. This has to do with the default chat click behaviour provided by the ChatListFragment. For the onProfileAvatarClick, the default behaviour is to open that chat’s profile, which can be a group or a single person. If you wish to replace this behaviour with your own functionality, simply return false in any of the overridden methods.

Once you click on a group profile you will be presented with the following screen:

group_profile.png

You can edit the profile of the group by clicking on the “edit” button (represented by a pencil icon) at the top right corner of the screen to edit the profile:

group_profile_edit.png

NOTE: Please keep in mind only creators of a group can edit their profile.

This section refers to group chat profiles only. For information about single user profiles refer to the User profiles section.