Я пытаюсь получить список пользователей по их именам после изменения текста в тексте редактирования, но не могу ничего отобразить.
FirebaseRecyclerAdapter
@Override
public void afterTextChanged(Editable editable) {
String typedText = editable.toString();
query = mDatabase.child("users").orderByChild("name").startAt(typedText).endAt(typedText+"\uf8ff");
firebaseRecyclerOptions = new FirebaseRecyclerOptions.Builder<UserModel_member_DP_NAME>().setQuery(query,UserModel_member_DP_NAME.class).build();
firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<UserModel_member_DP_NAME, User_MemberHolder>(firebaseRecyclerOptions) {
@Override
protected void onBindViewHolder(final User_MemberHolder holder, int position, final UserModel_member_DP_NAME model) {
holder.setContent(holder.itemView.getContext(),model.getDp(),model.getName());
}
@Override
public User_MemberHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.set_meeting_userlist_item,parent,false);
return new User_MemberHolder(v);
}
};
recyclerView.setAdapter(firebaseRecyclerAdapter);
}
ViewHolder
private class User_MemberHolder extends RecyclerView.ViewHolder{
ImageView img;
TextView txt;
User_MemberHolder(View itemView) {
super(itemView);
img = itemView.findViewById(R.id.set_meeting_userlist_imgview);
txt = itemView.findViewById(R.id.set_meeting_userlist_txtview);
}
void setContent(Context context, String imgUri , String nameString){
txt.setText(nameString);
Picasso.with(context).load(imgUri).into(img);
}
}