public class RVCommentAdapter
extends <any>
Modifier and Type | Class and Description |
---|---|
static interface |
RVCommentAdapter.OnItemClickListener
Interface implemented by any listener for item clicks
|
(package private) static class |
RVCommentAdapter.PostReplyViewHolder
Holder for the parts of each
View in the list |
Modifier and Type | Field and Description |
---|---|
private java.util.List<org.codethechange.culturemesh.models.PostReply> |
comments
Comments to show in the list
|
private android.content.Context |
context
Context of the list where the comments are displayed |
private RVCommentAdapter.OnItemClickListener |
listener
Listener to handle clicks on list items
|
Constructor and Description |
---|
RVCommentAdapter(java.util.List<org.codethechange.culturemesh.models.PostReply> comments,
RVCommentAdapter.OnItemClickListener listener,
android.content.Context context)
Store parameters in instance fields
|
Modifier and Type | Method and Description |
---|---|
int |
getItemCount()
Get the number of comments in the list
|
void |
onBindViewHolder(RVCommentAdapter.PostReplyViewHolder pvh,
int i)
Fill in the fields of
pvh with the information stored in the PostReply at
position i in the list of comments |
RVCommentAdapter.PostReplyViewHolder |
onCreateViewHolder(android.view.ViewGroup parent,
int viewType)
Create a
RVCommentAdapter.PostReplyViewHolder for parent with a View inflated
from R.layout#comment_view |
private java.util.List<org.codethechange.culturemesh.models.PostReply> comments
private android.content.Context context
Context
of the list where the comments are displayedprivate final RVCommentAdapter.OnItemClickListener listener
public RVCommentAdapter(java.util.List<org.codethechange.culturemesh.models.PostReply> comments, RVCommentAdapter.OnItemClickListener listener, android.content.Context context)
comments
- List of comments to display in scrollable list to userlistener
- Will be called whenever an item is clickedcontext
- Context
within which the list will be displayedpublic RVCommentAdapter.PostReplyViewHolder onCreateViewHolder(android.view.ViewGroup parent, int viewType)
RVCommentAdapter.PostReplyViewHolder
for parent
with a View
inflated
from R.layout#comment_view
parent
- ViewGroup
within which to create the RVCommentAdapter.PostReplyViewHolder
viewType
- Not usedRVCommentAdapter.PostReplyViewHolder
associated with the inflated View
public void onBindViewHolder(RVCommentAdapter.PostReplyViewHolder pvh, int i)
pvh
with the information stored in the PostReply
at
position i
in the list of commentspvh
- View
in the list whose fields will be filled-ini
- Index of PostReply
in comments
to use as the source
of information to fill withpublic int getItemCount()