Class DateAdapter

    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.cheetahdigital.uikit.widget.list.ListAdapter

        com.cheetahdigital.uikit.widget.list.ListAdapter.EmptyViewHolder
    • Field Summary

      • Fields inherited from class com.cheetahdigital.uikit.widget.list.ListAdapter

        VIEW_TYPE_HEADER, VIEW_TYPE_NORMAL
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAll​(java.util.List<EventDate> data)
      Appends all of the elements in the specified collection to the end of this list and notifies registered observers that the item list has been changed.
      protected void bindNormalViewHolder​(DateViewHolder holder, int position)
      Abstract method to bind the normal view holder.
      protected DateViewHolder createNormalViewHolder​(android.view.ViewGroup parent, int viewType)
      Abstract method to create normal view holder.
      void enableUseOriginalWidth​(boolean useOriginalWidth)
      Enable the use of original width
      void next()
      Select the next item and update the properties of the view to be in selected state
      void previous()
      Select previous item and update the properties of the view in selected state
      void setOriginalWidth​(int originalWidth)
      Set the original width of each date cell
      void setSelectedIndex​(int selectedIndex)
      Set the current selected index
      void updateSelectedIndex​(int index)
      Update the selected index and the views for the current cell
      • Methods inherited from class com.cheetahdigital.uikit.widget.list.ListAdapter

        addItem, addItem, clear, getDataList, getItemAt, getItemCount, getItemViewType, getPlaceHolderResource, insertItems, isListEmpty, onBindViewHolder, onCreateViewHolder, removeItem, replaceItemAt, setCustomEmptyMessageResource, setPlaceHolderResource, sort
      • Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter

        bindViewHolder, createViewHolder, getItemId, 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

      • DateAdapter

        public DateAdapter​(android.content.Context context,
                           java.util.List<EventDate> dataList)
        Constructor for DateAdapter
        Parameters:
        context - context of the view that the adapter to be attached
        dataList - list of EventDate to be displayed
    • Method Detail

      • createNormalViewHolder

        protected DateViewHolder createNormalViewHolder​(android.view.ViewGroup parent,
                                                        int viewType)
        Description copied from class: com.cheetahdigital.uikit.widget.list.ListAdapter
        Abstract method to create normal view holder.
        Specified by:
        createNormalViewHolder in class com.cheetahdigital.uikit.widget.list.ListAdapter<EventDate,​DateViewHolder>
        Parameters:
        parent - used to get resource
        viewType - type of view
        Returns:
        view holder for non special items
      • bindNormalViewHolder

        protected void bindNormalViewHolder​(DateViewHolder holder,
                                            int position)
        Description copied from class: com.cheetahdigital.uikit.widget.list.ListAdapter
        Abstract method to bind the normal view holder.
        Specified by:
        bindNormalViewHolder in class com.cheetahdigital.uikit.widget.list.ListAdapter<EventDate,​DateViewHolder>
        Parameters:
        holder - view holder to vindS
        position - index of the item
      • addAll

        public void addAll​(java.util.List<EventDate> data)
        Description copied from class: com.cheetahdigital.uikit.widget.list.ListAdapter
        Appends all of the elements in the specified collection to the end of this list and notifies registered observers that the item list has been changed.
        Overrides:
        addAll in class com.cheetahdigital.uikit.widget.list.ListAdapter<EventDate,​DateViewHolder>
        Parameters:
        data - list of items to add
      • enableUseOriginalWidth

        public void enableUseOriginalWidth​(boolean useOriginalWidth)
        Enable the use of original width
        Parameters:
        useOriginalWidth - true to use original width, else false
      • setOriginalWidth

        public void setOriginalWidth​(int originalWidth)
        Set the original width of each date cell
        Parameters:
        originalWidth - widht of date cell
      • setSelectedIndex

        public void setSelectedIndex​(int selectedIndex)
        Set the current selected index
        Parameters:
        selectedIndex - current index selected
      • updateSelectedIndex

        public void updateSelectedIndex​(int index)
        Update the selected index and the views for the current cell
        Parameters:
        index - index to set as selected
      • next

        public void next()
        Select the next item and update the properties of the view to be in selected state
      • previous

        public void previous()
        Select previous item and update the properties of the view in selected state