public class ListUserPostsFragment extends Fragment implements RVAdapter.OnItemClickListener
Post
s a User
has made.Modifier and Type | Field and Description |
---|---|
(package private) android.widget.TextView |
emptyText
Displays
R.string#no_posts if there are no Post s to display |
(package private) RequestQueue |
queue
Queue for asynchronous tasks
|
(package private) android.view.View |
root
The inflated user interface
|
(package private) RecyclerView |
rv
Scrollable list of
Post s |
Constructor and Description |
---|
ListUserPostsFragment() |
Modifier and Type | Method and Description |
---|---|
static ListUserPostsFragment |
newInstance(long selUser)
Returns a new instance of this fragment for the given section
number.
|
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
Create the user interface.
|
void |
onItemClick(org.codethechange.culturemesh.models.FeedItem item)
When the user clicks on an item, redirect them to
SpecificPostActivity where more
details, including comments, are displayed. |
void |
onStop()
This ensures that we are canceling all network requests if the user is leaving this activity.
|
android.view.View root
RecyclerView rv
Post
sandroid.widget.TextView emptyText
R.string#no_posts
if there are no Post
s to displayRequestQueue queue
public static ListUserPostsFragment newInstance(long selUser)
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
Post
s with the result from
API.Get#userPosts(RequestQueue, long, Response.Listener)
inflater
- Inflates the user interface from R.layout#rv_container
with the
provided container
as the parent.container
- Parent used by inflater
savedInstanceState
- Not usedpublic void onItemClick(org.codethechange.culturemesh.models.FeedItem item)
SpecificPostActivity
where more
details, including comments, are displayed.onItemClick
in interface RVAdapter.OnItemClickListener
item
- The clicked item.public void onStop()