public class UsersListAdapter
extends <any>
Modifier and Type | Class and Description |
---|---|
(package private) class |
UsersListAdapter.ViewHolder
Holder of UI elements that compose each element of the displayed list
|
Modifier and Type | Field and Description |
---|---|
(package private) android.content.Context |
context
Context in which the list is being displayed |
private java.util.ArrayList<org.codethechange.culturemesh.models.User> |
users
List of
User s to display in the list |
Constructor and Description |
---|
UsersListAdapter(android.content.Context context,
java.util.ArrayList<org.codethechange.culturemesh.models.User> users)
Create a new object by instantiating instance fields with parameters
|
Modifier and Type | Method and Description |
---|---|
int |
getItemCount()
Get the number of items in the list of objects to display
|
java.util.ArrayList<org.codethechange.culturemesh.models.User> |
getUsers()
Get the list of objects to display
|
void |
onBindViewHolder(UsersListAdapter.ViewHolder holder,
int position)
Fill the name and profile picture fields of
holder with the contents of an item in
users . |
UsersListAdapter.ViewHolder |
onCreateViewHolder(android.view.ViewGroup parent,
int viewType)
Create a new
UsersListAdapter.ViewHolder from a View inflated from
R.layout#user_list_item and with parent parent |
android.content.Context context
Context
in which the list is being displayedprivate java.util.ArrayList<org.codethechange.culturemesh.models.User> users
User
s to display in the listpublic UsersListAdapter(android.content.Context context, java.util.ArrayList<org.codethechange.culturemesh.models.User> users)
context
- Context
in which the list is displayedusers
- List of User
s to display in the listpublic UsersListAdapter.ViewHolder onCreateViewHolder(android.view.ViewGroup parent, int viewType)
UsersListAdapter.ViewHolder
from a View
inflated from
R.layout#user_list_item
and with parent parent
parent
- Parent for the View
used to create the new UsersListAdapter
viewType
- Not used.UsersListAdapter.ViewHolder
public void onBindViewHolder(UsersListAdapter.ViewHolder holder, int position)
holder
with the contents of an item in
users
.holder
- UsersListAdapter.ViewHolder
whose fields to fill with informationposition
- Index of item in list of users to use as source of information for fillingpublic int getItemCount()
public java.util.ArrayList<org.codethechange.culturemesh.models.User> getUsers()