Display filter only if there are more than 2 members in this room

This commit is contained in:
Benoit Marty 2020-10-12 15:54:58 +02:00 committed by Benoit Marty
parent 5ef97362cb
commit 4ac62bcf51

View File

@ -88,7 +88,6 @@ class RoomMemberListFragment @Inject constructor(
} }
private fun setupSearchView() { private fun setupSearchView() {
searchViewAppBarLayout.isVisible = true
searchView.queryHint = getString(R.string.search_members_hint) searchView.queryHint = getString(R.string.search_members_hint)
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String): Boolean { override fun onQueryTextSubmit(query: String): Boolean {
@ -111,6 +110,8 @@ class RoomMemberListFragment @Inject constructor(
roomMemberListController.setData(viewState) roomMemberListController.setData(viewState)
renderRoomSummary(viewState) renderRoomSummary(viewState)
inviteUsersButton.isVisible = viewState.actionsPermissions.canInvite inviteUsersButton.isVisible = viewState.actionsPermissions.canInvite
// Display filter only if there are more than 2 members in this room
searchViewAppBarLayout.isVisible = viewState.roomSummary()?.otherMemberIds.orEmpty().size > 1
} }
override fun onRoomMemberClicked(roomMember: RoomMemberSummary) { override fun onRoomMemberClicked(roomMember: RoomMemberSummary) {