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 ofIteminOrderDetailsActivity
-
-
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 voidaddAll(java.util.List<Item> data)Appends all the items in list ofItemprotected ItemgetItemAt(int position)Returns theItemat the specified position.intgetItemCount()java.util.List<Item>getItemList()Returns the list ofItemvoidonBindViewHolder(ItemViewHolder itemViewHolder, int i)ItemViewHolderonCreateViewHolder(android.view.ViewGroup parent, int i)voidsetCurrency(java.lang.String currency)Set the currency of amounts.voidsetDecimalPlacesCount(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:
onCreateViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<ItemViewHolder>
-
onBindViewHolder
public void onBindViewHolder(@NonNull ItemViewHolder itemViewHolder, int i)- Specified by:
onBindViewHolderin classandroidx.recyclerview.widget.RecyclerView.Adapter<ItemViewHolder>
-
getItemAt
protected Item getItemAt(int position)
Returns theItemat the specified position.- Parameters:
position- index of the item to return- Returns:
Itemat the specified position
-
getItemCount
public int getItemCount()
- Specified by:
getItemCountin 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
-
-