From 4ac62bcf51d1569cf0679d2f340bf642d17704d0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 12 Oct 2020 15:54:58 +0200 Subject: [PATCH] Display filter only if there are more than 2 members in this room --- .../app/features/roomprofile/members/RoomMemberListFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt index 77337d7208..a00bcf02fc 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/members/RoomMemberListFragment.kt @@ -88,7 +88,6 @@ class RoomMemberListFragment @Inject constructor( } private fun setupSearchView() { - searchViewAppBarLayout.isVisible = true searchView.queryHint = getString(R.string.search_members_hint) searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { override fun onQueryTextSubmit(query: String): Boolean { @@ -111,6 +110,8 @@ class RoomMemberListFragment @Inject constructor( roomMemberListController.setData(viewState) renderRoomSummary(viewState) 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) {