public class MessageAdapter extends RecyclerView.Adapter<edu.cnm.deepdive.keepintouch.adapter.MessageAdapter.Holder>
Modifier and Type | Class and Description |
---|---|
static interface |
MessageAdapter.OnSendClickListener
An interface that listens for when the Send It button is clicked and an autoReply is selected
from the associated spinner.
|
Constructor and Description |
---|
MessageAdapter(Context context,
List<Message> messages,
List<? extends AutoReply> autoReplies,
MessageAdapter.OnSendClickListener listener)
Constructor for the messaging RecyclerView.
|
Modifier and Type | Method and Description |
---|---|
int |
getItemCount() |
void |
onBindViewHolder(edu.cnm.deepdive.keepintouch.adapter.MessageAdapter.Holder holder,
int position) |
edu.cnm.deepdive.keepintouch.adapter.MessageAdapter.Holder |
onCreateViewHolder(ViewGroup parent,
int viewType) |
bindViewHolder, createViewHolder, getItemId, getItemViewType, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver
public MessageAdapter(Context context, List<Message> messages, List<? extends AutoReply> autoReplies, MessageAdapter.OnSendClickListener listener)
context
- is the context of the this activitymessages
- a list of autoReplies prepopulated into the database with a CSV file parserautoReplies
- listener
- @NonNull public edu.cnm.deepdive.keepintouch.adapter.MessageAdapter.Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
onCreateViewHolder
in class RecyclerView.Adapter<edu.cnm.deepdive.keepintouch.adapter.MessageAdapter.Holder>
public void onBindViewHolder(@NonNull edu.cnm.deepdive.keepintouch.adapter.MessageAdapter.Holder holder, int position)
onBindViewHolder
in class RecyclerView.Adapter<edu.cnm.deepdive.keepintouch.adapter.MessageAdapter.Holder>
public int getItemCount()
getItemCount
in class RecyclerView.Adapter<edu.cnm.deepdive.keepintouch.adapter.MessageAdapter.Holder>