use of com.macbitsgoa.ard.viewholders.TextViewHolder 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);
}
}
use of com.macbitsgoa.ard.viewholders.TextViewHolder in project ARD by MobileApplicationsClub.
the class PostDetailsAdapter method onCreateViewHolder.
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull final ViewGroup parent, final int viewType) {
final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
final View view;
switch(viewType) {
case HomeType.TEXT_ITEM:
view = inflater.inflate(R.layout.vh_big_text, parent, false);
return new TextViewHolder(view, R.id.tv_vh_big_text);
case HomeType.PHOTO_ITEM:
view = inflater.inflate(R.layout.vh_big_image, parent, false);
return new ImageViewHolder(view, parent.getContext(), R.id.imgView_vh_big_image, this);
}
return null;
}
Aggregations