/ UIKit / Android View
UIKit
Chat UIKit Android View v3
Chat UIKit Android View
Chat UIKit
Android View
Version 3

Filter user list

Copy link

You can filter and display only certain users in the user list managed by the UIKit. By customizing the user list, you can create a more tailored experience for your application.


User attributes

Copy link

The users of the UIKit inherits from the UserInfo interface. The following table lists the properties of UserInfo.

PropertiesTypeDescription

userId

String

The unique ID of the user.

nickname

String?

The user's nickname. (Default: null)

profileUrl

String?

The URL of the user's profile image. (Default: null)


Filter user list

Copy link

You can filter the user list by creating a custom adapter after inheriting from the CreateChannelUserListAdapter. To learn how to apply custom adapters, refer to this page.

KotlinJava
class CustomFilterCreateChannelUserListAdapter : CreateChannelUserListAdapter() {

    /**
     * Only filter users whose nickname contains "E"
     */
    private val filteredUserList: List<UserInfo>
        get() = userList.filter { it.nickname?.contains("E", ignoreCase = true) == true }

    override fun getItem(position: Int): UserInfo {
        return filteredUserList[position]
    }
    override fun getItemCount(): Int {
        return filteredUserList.count()
    }
}

For an in-depth practical demonstration, see our sample code.