use of com.macbitsgoa.ard.viewholders.NewChatViewHolder in project ARD by MobileApplicationsClub.
the class NewChatAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder generalHolder, final int position) {
if (generalHolder.getItemViewType() == TEXT) {
final TextViewHolder holder = (TextViewHolder) generalHolder;
if (position == admins.size() + 1)
holder.setText("Users");
else
holder.setText("Admins");
} else {
final NewChatViewHolder holder = (NewChatViewHolder) generalHolder;
UserItem ui;
if (position <= admins.size())
ui = admins.get(position - 1);
else
ui = users.get(position - admins.size() - 2);
holder.setUi(ui);
}
}
Aggregations