public class

TimelineCellProvider

extends RecyclerView.Adapter<VH extends RecyclerView.ViewHolder>
implements TimelineStickyHeader.TimelineHeaderInterface
java.lang.Object
   ↳ androidx.recyclerview.widget.RecyclerView.Adapter<VH extends androidx.recyclerview.widget.RecyclerView.ViewHolder>
     ↳ com.sap.cloud.mobile.fiori.timeline.TimelineCellProvider

Class Overview

A User defined Type for mapping data into Timeline cells. Is a sub class of RecyclerView.Adapter and encapsulates the logic for creating, binding, sorting, and drawing different UI elements of TimelineView. TimelineCellProvider class is supposed to be used with TimelineView.

Summary

Fields
protected WeakReference<Context> mContext
protected boolean mIsLoading
protected List<TimelineCellData> mOrderedCellDataList
protected WeakReference<Context> mParentContext
protected boolean mShouldDisplayTimestamp
protected float mTimelineLineWidth
protected int mTodayIndex
Public Constructors
TimelineCellProvider()
Public Methods
TimelineCellView getHeaderAtPosition(int position)
int getHeight()
boolean getIsLoading()
int getItemCount()
int getItemViewType(int position)
Gets the TimelineCellType of cell available at given position
List<TimelineCellData> getOrderedCellsList()
TimelineCellView.TimelineCellType getTimelineCellType(int position)
Gets the type of cell at index position.
int getTodayIndex()
boolean isHeader(int position)
void onBindView(TimelineCellView view, int position, int viewType)
Bind the item available at index position Override this method if data is to be filled by callback mechanism.
final void onBindViewHolder(TimelineCellViewHolder cellViewHolder, int position)
Binds the cellViewHolder with a view at index position.
final TimelineCellViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
Creates a view holder
void onViewRecycled(TimelineCellViewHolder holder)
Reset the timeline cells once they are recycled.
void setCellList(Context context, List<TimelineCellData> list)
void setIsLoading(boolean isLoading)
void setTimelineLineWidth(float width)
Protected Methods
void setShouldDisplayTimestamp(boolean shouldDisplay)
[Expand]
Inherited Methods
From class androidx.recyclerview.widget.RecyclerView.Adapter
From class java.lang.Object
From interface com.sap.cloud.mobile.fiori.timeline.TimelineStickyHeader.TimelineHeaderInterface

Fields

protected WeakReference<Context> mContext

protected boolean mIsLoading

protected List<TimelineCellData> mOrderedCellDataList

protected WeakReference<Context> mParentContext

protected boolean mShouldDisplayTimestamp

protected float mTimelineLineWidth

protected int mTodayIndex

Public Constructors

public TimelineCellProvider ()

Public Methods

public TimelineCellView getHeaderAtPosition (int position)

public int getHeight ()

public boolean getIsLoading ()

public int getItemCount ()

public int getItemViewType (int position)

Gets the TimelineCellType of cell available at given position

public List<TimelineCellData> getOrderedCellsList ()

public TimelineCellView.TimelineCellType getTimelineCellType (int position)

Gets the type of cell at index position.

public int getTodayIndex ()

public boolean isHeader (int position)

public void onBindView (TimelineCellView view, int position, int viewType)

Bind the item available at index position Override this method if data is to be filled by callback mechanism.

Parameters
view TimelineCellView
position int
viewType type of view see getItemViewType(int)

public final void onBindViewHolder (TimelineCellViewHolder cellViewHolder, int position)

Binds the cellViewHolder with a view at index position.

public final TimelineCellViewHolder onCreateViewHolder (ViewGroup parent, int viewType)

Creates a view holder

public void onViewRecycled (TimelineCellViewHolder holder)

Reset the timeline cells once they are recycled.

Parameters
holder TimelineCellViewHolder

public void setCellList (Context context, List<TimelineCellData> list)

public void setIsLoading (boolean isLoading)

public void setTimelineLineWidth (float width)

Protected Methods

protected void setShouldDisplayTimestamp (boolean shouldDisplay)