public class

TimelineView

extends ViewGroup
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ com.sap.cloud.mobile.fiori.timeline.TimelineView

Class Overview

This class represents the Timeline view of the Fiori user interface components. A Timeline view represents a sequence of cells represented over the Timeline. This view visualizes TimelineLineView along with the Card view to create the visual appearance of activities occurring over a span of time.

Using Timeline views

All of the cells in a timeline are arranged in a sequence which are inflated using TimelineCellProvider

TimelineCellProvider: Timeline view is a sub class of Recycler View and uses TimelineCellProvider as adapter to provide the cells. Using TimelineView as RecyclerView or using TimelineView with an Adapter other than TimelineCellProvider is not advisable. TimelineView should only be used with TimelineCellProvider. TimelineView uses a LinearLayout in vertical orientation to add children views.

Summary

[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
Fields
protected TimelineCellProvider mAdapter
protected TimelineItemTouchListener.TimelineItemClickListener mClickListener
protected CharSequence mEmptyDesc
protected TextView mEmptyDescView
protected Drawable mEmptyDrawable
protected CharSequence mEmptyHeadline
protected TextView mEmptyHeadlineView
protected float mEmptyHeight
protected ImageView mEmptyImage
protected float mEmptyWidth
protected boolean mShouldDisplayTimestamp
protected float mTimelineLineWidth
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
TimelineView(Context context)
TimelineView(Context context, AttributeSet attrs)
TimelineView(Context context, AttributeSet attrs, int defStyleAttr)
TimelineView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
CharSequence getEmptyDescription()
Drawable getEmptyDrawable()
CharSequence getEmptyHeadline()
void scrollBy(int x, int y)
void scrollToToday()
void setAdapter(TimelineCellProvider adapter)
Ensure that the given adapter is of type TimelineCellProvider.
void setCellListAndScroll(Context context, List<TimelineCellData> list)
Tells TimelineCellProvider to create the list of cells and activate the initial scroll to the TODAY cell.
void setClickListener(TimelineItemTouchListener.TimelineItemClickListener listener)
void setEmptyDescription(CharSequence desc)
void setEmptyDrawable(Drawable icon)
void setEmptyHeadline(CharSequence headline)
void setShouldDisplayTimestamp(boolean shouldDisplay)
void setTimelineLineWidth(float width)
Protected Methods
void init()
void initializeStyledAttributes(AttributeSet attrs, int defStyle, int defStyleRes)
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[Expand]
Inherited Methods
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Fields

protected TimelineCellProvider mAdapter

protected CharSequence mEmptyDesc

protected TextView mEmptyDescView

protected Drawable mEmptyDrawable

protected CharSequence mEmptyHeadline

protected TextView mEmptyHeadlineView

protected float mEmptyHeight

protected ImageView mEmptyImage

protected float mEmptyWidth

protected boolean mShouldDisplayTimestamp

protected float mTimelineLineWidth

Public Constructors

public TimelineView (Context context)

public TimelineView (Context context, AttributeSet attrs)

public TimelineView (Context context, AttributeSet attrs, int defStyleAttr)

public TimelineView (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public CharSequence getEmptyDescription ()

public Drawable getEmptyDrawable ()

public CharSequence getEmptyHeadline ()

public void scrollBy (int x, int y)

public void scrollToToday ()

public void setAdapter (TimelineCellProvider adapter)

Ensure that the given adapter is of type TimelineCellProvider. Set a new adapter to provide child views on demand.

When adapter is changed, all existing views are recycled back to the pool. If the pool has only one adapter, it will be cleared.

Parameters
adapter The new adapter to set, or null to set no adapter.

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

Tells TimelineCellProvider to create the list of cells and activate the initial scroll to the TODAY cell. Should be used if setAdapter() has already been called before providing a list to TimelineCellProvider and the initial scroll to the TODAY cell has not been activated yet. Otherwise, use TimelineCellProvider's setCellList().

Parameters
context The context the view is in
list The list of TimelineCellData to be converted into TimelineCellView

public void setClickListener (TimelineItemTouchListener.TimelineItemClickListener listener)

public void setEmptyDescription (CharSequence desc)

public void setEmptyDrawable (Drawable icon)

public void setEmptyHeadline (CharSequence headline)

public void setShouldDisplayTimestamp (boolean shouldDisplay)

public void setTimelineLineWidth (float width)

Protected Methods

protected void init ()

protected void initializeStyledAttributes (AttributeSet attrs, int defStyle, int defStyleRes)

protected void onLayout (boolean changed, int l, int t, int r, int b)

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)