mentorship-android
mentorship-android copied to clipboard
Search feature is not working
Describe the bug After merging all GCI search feature is not working as expected
To Reproduce Steps to reproduce the behavior:
- Go to members
- Click on search icon
- Type in username which exists
- See the list is empty
- Press cross to cancel search 6 See list is not reverted
Expected behavior Search shows existing users by username or name
Screenshots
![]() |
![]() |
![]() |
---|
Hey @annabauza @isabelcosta! Can I work on this issue?
@sidvenu You can work on this issue. Before sending the PR can you tell what has gone wrong and why the search isn't working.
I'm still working on this issue - it took me some time to set up the local server. Trying to find the issue now.
Just a status update - I was caught up with quite a lot of work the past few days, I'll be done with the issue by this weekend.
Cool @sidvenu ! thank you so much for the update :)
MembersAdapter
has a userList
and a filteredUserList
. The filteredUserList
is what is shown to the user.
When a search term is entered, an object of MembersAdapter
class is created. But, whenever MembersAdapter
is created, the userList
is set in the object, but filteredUserList
is empty (filteredUserList = mutableListOf<User>()
). So, only an empty list is used to show the members to the user, thus the search feature wouldn't work.
There are different approaches to solve this, and I've made the changes in such a way it doesn't affect other features of the app. I'll submit a PR for the same.