Class OrderItemsAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<ItemViewHolder>
-
- com.cheetahdigital.orders.ui.details.OrderItemsAdapter
-
public class OrderItemsAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<ItemViewHolder>
The adapter for the list ofItem
inOrderDetailsActivity
-
-
Constructor Summary
Constructors Constructor Description OrderItemsAdapter(java.util.List<Item> itemList)
Constructor of the adapter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAll(java.util.List<Item> data)
Appends all the items in list ofItem
protected Item
getItemAt(int position)
Returns theItem
at the specified position.int
getItemCount()
java.util.List<Item>
getItemList()
Returns the list ofItem
void
onBindViewHolder(ItemViewHolder itemViewHolder, int i)
ItemViewHolder
onCreateViewHolder(android.view.ViewGroup parent, int i)
void
setCurrency(java.lang.String currency)
Set the currency of amounts.void
setDecimalPlacesCount(int decimalPlacesCount)
Set number of decimal places in amounts.-
Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, getItemId, getItemViewType, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver
-
-
-
-
Method Detail
-
getItemList
public java.util.List<Item> getItemList()
Returns the list ofItem
- Returns:
- list of
Item
-
addAll
public void addAll(java.util.List<Item> data)
Appends all the items in list ofItem
- Parameters:
data
- list ofItem
-
onCreateViewHolder
@NonNull public ItemViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int i)
- Specified by:
onCreateViewHolder
in classandroidx.recyclerview.widget.RecyclerView.Adapter<ItemViewHolder>
-
onBindViewHolder
public void onBindViewHolder(@NonNull ItemViewHolder itemViewHolder, int i)
- Specified by:
onBindViewHolder
in classandroidx.recyclerview.widget.RecyclerView.Adapter<ItemViewHolder>
-
getItemAt
protected Item getItemAt(int position)
Returns theItem
at the specified position.- Parameters:
position
- index of the item to return- Returns:
Item
at the specified position
-
getItemCount
public int getItemCount()
- Specified by:
getItemCount
in classandroidx.recyclerview.widget.RecyclerView.Adapter<ItemViewHolder>
-
setDecimalPlacesCount
public void setDecimalPlacesCount(int decimalPlacesCount)
Set number of decimal places in amounts. Default value is 2, e.g. 100.00.- Parameters:
decimalPlacesCount
- number of decimal places
-
setCurrency
public void setCurrency(java.lang.String currency)
Set the currency of amounts. Default value is $, e.g. $100.00- Parameters:
currency
- number of decimal places
-
-