static class RVAdapter.PostViewHolder
extends RecyclerView.ViewHolder
View
elements of each item in the displayed list. Instances of this class
are linked to objects in RVAdapter.netPosts
by
RVAdapter.onBindViewHolder(PostViewHolder, int)
, which fills the fields with content
from the object.Modifier and Type | Field and Description |
---|---|
(package private) android.widget.TextView |
attending
Text fields for both
Post and Event information |
(package private) android.widget.RelativeLayout |
comment1Layout
Layout within which the two displayed comments are defined
|
(package private) android.widget.TextView |
comment1Name
Text fields for both
Post and Event information |
(package private) android.widget.TextView |
comment1Text
Text fields for both
Post and Event information |
(package private) android.widget.RelativeLayout |
comment2Layout
Layout within which the two displayed comments are defined
|
(package private) android.widget.TextView |
comment2Name
Text fields for both
Post and Event information |
(package private) android.widget.TextView |
comment2Text
Text fields for both
Post and Event information |
(package private) android.widget.TextView |
content
Text fields for both
Post and Event information |
(package private) CardView |
cv
The
View for the displayed list item |
(package private) android.widget.TextView |
eventDescription
Description of the
Event |
(package private) android.widget.LinearLayout |
eventDetailsLL
Layout within which the details section of the displayed list item is defined
|
(package private) android.widget.TextView |
eventLocation
Where the
Event will take place |
(package private) android.widget.TextView |
eventTime
Time of the
Event |
(package private) android.widget.TextView |
eventTitle
Text fields for both
Post and Event information |
(package private) android.widget.ImageView[] |
images
Array of all image displays
|
(package private) ConstraintLayout |
layout
Layout within which the displayed list item is defined
|
(package private) android.widget.TextView |
personName
Text fields for both
Post and Event information |
(package private) android.widget.ImageView |
personPhoto
Display images with the displayed list item
|
(package private) boolean |
post
Whether this instance is configured to display the information for a
Post or for
a Event . |
(package private) android.widget.ImageView |
postTypePhoto
Display images with the displayed list item
|
(package private) android.widget.TextView |
timestamp
Text fields for both
Post and Event information |
(package private) android.widget.TextView |
username
Text fields for both
Post and Event information |
(package private) android.widget.TextView |
viewMoreComments
Text fields for both
Post and Event information |
Constructor and Description |
---|
PostViewHolder(android.view.View itemView)
Initialize instance fields by retrieving UI elements by their IDs in the provided
View |
Modifier and Type | Method and Description |
---|---|
void |
bind(org.codethechange.culturemesh.models.FeedItem item,
RVAdapter.OnItemClickListener listener)
Set the displayed list item's listener that handles clicks to that of the provided
listener
|
(package private) void |
hideEventViews()
This instance will display the information from a
Post , so hide all the fields
that describe Event s |
(package private) void |
hidePostViews()
This instance will display the information from a
Event , so hide all the fields
that describe Post s |
boolean |
isPost()
Check whether the instance is displaying information for a
Post or a Event |
boolean post
Post
or for
a Event
. true
if it is for a Post
CardView cv
View
for the displayed list itemandroid.widget.TextView personName
Post
and Event
informationandroid.widget.TextView username
Post
and Event
informationandroid.widget.TextView content
Post
and Event
informationandroid.widget.TextView timestamp
Post
and Event
informationandroid.widget.TextView eventTitle
Post
and Event
informationandroid.widget.TextView comment1Name
Post
and Event
informationandroid.widget.TextView comment1Text
Post
and Event
informationandroid.widget.TextView comment2Name
Post
and Event
informationandroid.widget.TextView comment2Text
Post
and Event
informationandroid.widget.TextView viewMoreComments
Post
and Event
informationandroid.widget.TextView attending
Post
and Event
informationandroid.widget.ImageView personPhoto
android.widget.ImageView postTypePhoto
android.widget.ImageView[] images
android.widget.LinearLayout eventDetailsLL
android.widget.TextView eventTime
Event
android.widget.TextView eventLocation
Event
will take placeandroid.widget.TextView eventDescription
Event
ConstraintLayout layout
android.widget.RelativeLayout comment1Layout
android.widget.RelativeLayout comment2Layout
PostViewHolder(android.view.View itemView)
View
itemView
- Canvas upon which the displayed list item is built. Should already have
the needed fields and other elements.public boolean isPost()
Post
or a Event
true
if displaying information for a Post
. false
if
for an Event
void hidePostViews()
Event
, so hide all the fields
that describe Post
svoid hideEventViews()
Post
, so hide all the fields
that describe Event
spublic void bind(org.codethechange.culturemesh.models.FeedItem item, RVAdapter.OnItemClickListener listener)
item
- The clicked-on item which will be passed to the listener's
RVAdapter.OnItemClickListener.onItemClick(FeedItem)
method when the item is
clickedlistener
- Listener to handle all clicks on items in the list