I am building a fragment in which i have a searchBar for users and a recyclerView to display them. My question is how to change FirebaseRecyclerView Options every time i type something for searching, I found a solution with another adapter (not FirebaseRecyclerView Adapter) but it uses an ArrayList.
I want something like that for the options.
//userList contains all users
private void searchUser(String s) {
ArrayList<User> list = new ArrayList<>();
for(User object : userList){
String userName = object.Name + " " + object.Surname;
if(userName.toLowerCase().contains(s.toLowerCase())){
list.add(object);
}
}
UserAdapter adapter = new UserAdapter(list);
myUserList.setAdapter(adapter);
}
How to refresh the options every time i type something on search Bar?