Class OrderItemsAdapter

    • 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 of Item
      protected Item getItemAt​(int position)
      Returns the Item at the specified position.
      int getItemCount()  
      java.util.List<Item> getItemList()
      Returns the list of Item
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OrderItemsAdapter

        public OrderItemsAdapter​(@NonNull
                                 java.util.List<Item> itemList)
        Constructor of the adapter
        Parameters:
        itemList - list of Item
    • Method Detail

      • getItemList

        public java.util.List<Item> getItemList()
        Returns the list of Item
        Returns:
        list of Item
      • addAll

        public void addAll​(java.util.List<Item> data)
        Appends all the items in list of Item
        Parameters:
        data - list of Item
      • onCreateViewHolder

        @NonNull
        public ItemViewHolder onCreateViewHolder​(@NonNull
                                                 android.view.ViewGroup parent,
                                                 int i)
        Specified by:
        onCreateViewHolder in class androidx.recyclerview.widget.RecyclerView.Adapter<ItemViewHolder>
      • onBindViewHolder

        public void onBindViewHolder​(@NonNull
                                     ItemViewHolder itemViewHolder,
                                     int i)
        Specified by:
        onBindViewHolder in class androidx.recyclerview.widget.RecyclerView.Adapter<ItemViewHolder>
      • getItemAt

        protected Item getItemAt​(int position)
        Returns the Item 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 class androidx.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