public class ListUserEventsFragment extends Fragment implements RVAdapter.OnItemClickListener
Modifier and Type | Field and Description |
---|---|
(package private) android.widget.TextView |
emptyText
Text field that displays
R.string#no_events if there are no events to display |
(package private) RequestQueue |
queue
Queue for asynchronous tasks
|
(package private) RecyclerView |
rv
Scrollable list of events.
|
Constructor and Description |
---|
ListUserEventsFragment() |
Modifier and Type | Method and Description |
---|---|
static ListUserEventsFragment |
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)
Setup the user interface to display the list of events and populate that list with the
result of calling
API.Get#userEvents(RequestQueue, long, String, Response.Listener) . |
void |
onItemClick(com.culturemesh.android.models.FeedItem item)
When an item is clicked, if it is a
Post , the user is sent to a screen to view the
post in more detail, including comments. |
void |
onStop()
This ensures that we are canceling all network requests if the user is leaving this activity.
|
RecyclerView rv
android.widget.TextView emptyText
R.string#no_events
if there are no events to displayRequestQueue queue
public static ListUserEventsFragment newInstance(long selUser)
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
API.Get#userEvents(RequestQueue, long, String, Response.Listener)
.inflater
- Inflates the user interface specified in R.layout#rv_container
container
- Parent of the generated hierarchy of user interface elementssavedInstanceState
- Saved state to restorepublic void onItemClick(com.culturemesh.android.models.FeedItem item)
Post
, the user is sent to a screen to view the
post in more detail, including comments. If the item is an Event
, no action is taken.onItemClick
in interface RVAdapter.OnItemClickListener
item
- The item that was clickedpublic void onStop()