public class

TimelineCellView

extends AbstractEntityCell
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ com.sap.cloud.mobile.fiori.object.AbstractEntityCell
         ↳ com.sap.cloud.mobile.fiori.timeline.views.TimelineCellView
Known Direct Subclasses

Class Overview

A concrete class demonstrating a chronological event.

Structure

  • Chronology Bar
  • A Chronological bar representing the event. This bar can also be assigned a drawable as status of the event.

  • Due Date
  • A date when the event is due or occurred See setDueDate(Date).

  • State
  • The state of the Timeline cell. A cell can be in one of the multiple possible states. See TimelineCellView.TimelineCellState for possible states a cell can be. See setState(TimelineCellState), and getState().

  • Headline
  • This text field is the headline of the event.

  • Timestamp
  • This text field appears on the left side of the chronology bar.

Summary

Nested Classes
enum TimelineCellView.TimelineCellState Enum representing the state of the cell  
enum TimelineCellView.TimelineCellTimestampType Enum representing the timestamp type of the cell  
enum TimelineCellView.TimelineCellType Enum representing the type of the cell  
enum TimelineCellView.TimelineOrderType Enum representing the order placement of the cell  
enum TimelineCellView.TimelineTimeState Enum representing the relative time state of the cell  
XML Attributes
Attribute Name Related Method Description
TimelineCellView_timelineTimestampTextAppearance  
[Expand]
Inherited XML Attributes
From class com.sap.cloud.mobile.fiori.object.AbstractEntityCell
[Expand]
Inherited Constants
From class com.sap.cloud.mobile.fiori.object.AbstractEntityCell
From class android.view.ViewGroup
From class android.view.View
Fields
protected CharSequence mAttribute
protected float mAttributeHeight
protected StaticLayout mAttributeLayout
protected int mAttributeLines
protected int mAttributeTextAppearance
protected StaticLayoutTextView mAttributeTextView
protected float mBarPaddingEnd
protected float mBarPaddingStart
protected float mCardMargin
protected float mCardPadding
protected CardView mCardView
protected TimelineCellView.TimelineCellType mCellType
protected TimelineLineView mChronologyBar
protected DateFormat mDateFormatter
protected DateFormat mDayDateFormatter
protected int mDescriptionLines
protected Date mEndDate
protected float mFirstCellMarginTop
protected boolean mIsHeaderRtl
protected float mLastCellMarginBottom
protected CharSequence mMonth
protected DateFormat mMonthFormatter
protected float mMonthHeight
protected StaticLayout mMonthLayout
protected float mMonthPadding
protected TextPaint mMonthPaint
protected int mMonthTextAppearance
protected StaticLayoutTextView mMonthTextView
protected TimelineCellView.TimelineOrderType mOrderType
protected float mPaddingEnd
protected float mPaddingStart
protected int mParentWidth
protected boolean mShouldDisplayTimestamp
protected Date mStartDate
protected TimelineCellView.TimelineCellState mState
protected DateFormat mTimeFormatter
protected TimelineCellView.TimelineTimeState mTimeState
protected float mTimelineLineWidth
protected CharSequence mTimestamp
protected float mTimestampHeight
protected StaticLayout mTimestampLayout
protected TextPaint mTimestampPaint
protected int mTimestampTextAppearance
protected StaticLayoutTextView mTimestampTextView
protected TimelineCellView.TimelineCellTimestampType mTimestampType
protected float mTimestampWidth
protected Paint mTodayLinePaint
protected Paint mTodayPaint
[Expand]
Inherited Fields
From class com.sap.cloud.mobile.fiori.object.AbstractEntityCell
From class android.view.View
Public Constructors
TimelineCellView(Context context)
TimelineCellView(Context context, AttributeSet attrs)
TimelineCellView(Context context, AttributeSet attrs, int defStyleAttr)
TimelineCellView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void bind(TimelineCellData cell)
void copy(TimelineCellView cell)
CharSequence getAttribute()
Get the attribute of the cell.
int getAttributeLines()
TimelineCellView.TimelineCellType getCellType()
DateFormat getDateFormat()
DateFormat getDayDateFormat()
String getDayTime(Date date)
int getDescriptionLines()
Date getEndDate()
Get the end date of the cell.
CharSequence getMonth()
Get the month of the due date of the cell.
DateFormat getMonthFormat()
float getNodeSize()
TimelineCellView.TimelineOrderType getOrderType()
boolean getShouldDisplayTimestamp()
Date getStartDate()
Get the start date of the cell.
TimelineCellView.TimelineCellState getState()
Get the state of the Timeline cell
DateFormat getTimeFormat()
TimelineCellView.TimelineTimeState getTimeState()
float getTimelineLineWidth()
Drawable getTimelineNode()
CharSequence getTimestamp()
Get the timestamp of the cell.
TimelineCellView.TimelineCellTimestampType getTimestampType()
boolean isCardClicked(MotionEvent motionEvent, View view)
void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)
void recycle()
Recycle the view for reuse
void setAttribute(CharSequence attribute)
Set the attribute of the cell.
void setAttribute(int resId)
Set the attribute of the cell.
void setAttributeLines(int lines)
Set the maximum amount of lines available for the attribute.
void setAttributeTextAppearance(int resId)
Sets the text color, size, and style of the attribute from the specified TextAppearance resource.
void setCellType(TimelineCellView.TimelineCellType type)
void setChronologyBarType(TimelineLineView.LineType type)
Set the type of Chronology Bars.
void setDateFormat(String format)
void setDateFormat(DateFormat format)
void setDayDateFormat(String format)
void setDayDateFormat(DateFormat format)
void setDescription(CharSequence description)
Set the description of the cell.
void setDescription(int resId)
Set the description of the cell.
void setDescriptionLines(int lines)
Set the maximum amount of lines available for the description.
void setDueDate(Date startDate, Date endDate)
Set the date range of the cell.
void setDueDate(Date dueDate)
Set the due date of the cell.
void setEndLine(int color)
void setEndLine(Drawable endLine)
void setIsHeaderRtl(boolean isRtl, int parentWidth)
void setLinePadding(float padding)
void setLineSize(float lineSize)
void setMonthFormat(String format)
void setMonthFormat(DateFormat format)
void setMonthTextAppearance(int resId)
Sets the text color, size, and style of the month timestamp from the specified TextAppearance resource.
void setNodeSize(float nodeSize)
void setOrderType(TimelineCellView.TimelineOrderType type)
void setShouldDisplayTimestamp(boolean shouldDisplay)
Toggles whether the month and date will be displayed on the side, and allocates space accordingly.
void setStartLine(Drawable startLine)
void setStartLine(int color)
void setState(TimelineCellView.TimelineCellState state)
Set the state of the Timeline cell
void setTimeFormat(DateFormat format)
void setTimeFormat(String format)
void setTimeState(TimelineCellView.TimelineTimeState state)
void setTimelineLineWidth(float width)
void setTimelineNode(Drawable node)
void setTimelineNode(Drawable node, int color)
void setTimelineNodeColor(int color)
void setTimestampTextAppearance(int resId)
Sets the text color, size, and style of the timestamp from the specified TextAppearance resource.
void setTimestampType(TimelineCellView.TimelineCellTimestampType type)
void setTodayColor(int color)
void setTodayLineColor(int color)
void setTodayLinePaint(Paint paint)
void setTodayPaint(Paint paint)
Protected Methods
void addSystemView(View v)
Add the given view to the view group
void configureAttributeLayout()
void configureDescriptionLayout()
Configures StaticLayoutTextView for description field.
void configureHeadlineLayout()
Configures headline layout
void configureMonthLayout()
void configureTimestampLayout()
void init()
void initializeStyledAttributes(AttributeSet attrs, int defStyle, int defStyleRes)
void measureChildConstrained(View child, int parentWidthSpec, int widthUsed, int widthConstraint, int parentHeightSpec, int heightUsed, int heightConstraint)
Measure a child for given length and width constraints
void onDraw(Canvas canvas)
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
void setMonth(CharSequence month)
Set the month of this cell.
void setTimestamp(CharSequence timestamp)
Set the timestamp of this cell.
[Expand]
Inherited Methods
From class com.sap.cloud.mobile.fiori.object.AbstractEntityCell
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
From interface com.sap.cloud.mobile.fiori.object.KeylineProvider

XML Attributes

TimelineCellView_timelineTimestampTextAppearance

Related Methods

Fields

protected CharSequence mAttribute

protected float mAttributeHeight

protected StaticLayout mAttributeLayout

protected int mAttributeLines

protected int mAttributeTextAppearance

protected StaticLayoutTextView mAttributeTextView

protected float mBarPaddingEnd

protected float mBarPaddingStart

protected float mCardMargin

protected float mCardPadding

protected CardView mCardView

protected TimelineCellView.TimelineCellType mCellType

protected TimelineLineView mChronologyBar

protected DateFormat mDateFormatter

protected DateFormat mDayDateFormatter

protected int mDescriptionLines

protected Date mEndDate

protected float mFirstCellMarginTop

protected boolean mIsHeaderRtl

protected float mLastCellMarginBottom

protected CharSequence mMonth

protected DateFormat mMonthFormatter

protected float mMonthHeight

protected StaticLayout mMonthLayout

protected float mMonthPadding

protected TextPaint mMonthPaint

protected int mMonthTextAppearance

protected StaticLayoutTextView mMonthTextView

protected TimelineCellView.TimelineOrderType mOrderType

protected float mPaddingEnd

protected float mPaddingStart

protected int mParentWidth

protected boolean mShouldDisplayTimestamp

protected Date mStartDate

protected DateFormat mTimeFormatter

protected TimelineCellView.TimelineTimeState mTimeState

protected float mTimelineLineWidth

protected CharSequence mTimestamp

protected float mTimestampHeight

protected StaticLayout mTimestampLayout

protected TextPaint mTimestampPaint

protected int mTimestampTextAppearance

protected StaticLayoutTextView mTimestampTextView

protected float mTimestampWidth

protected Paint mTodayLinePaint

protected Paint mTodayPaint

Public Constructors

public TimelineCellView (Context context)

public TimelineCellView (Context context, AttributeSet attrs)

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

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

Public Methods

public void bind (TimelineCellData cell)

public void copy (TimelineCellView cell)

public CharSequence getAttribute ()

Get the attribute of the cell.

Returns
  • CharSequence

public int getAttributeLines ()

public TimelineCellView.TimelineCellType getCellType ()

public DateFormat getDateFormat ()

public DateFormat getDayDateFormat ()

public String getDayTime (Date date)

public int getDescriptionLines ()

public Date getEndDate ()

Get the end date of the cell.

Returns
  • Date
See Also

public CharSequence getMonth ()

Get the month of the due date of the cell.

Returns
  • CharSequence

public DateFormat getMonthFormat ()

public float getNodeSize ()

public TimelineCellView.TimelineOrderType getOrderType ()

public boolean getShouldDisplayTimestamp ()

public Date getStartDate ()

Get the start date of the cell.

Returns
  • Date
See Also

public TimelineCellView.TimelineCellState getState ()

Get the state of the Timeline cell

public DateFormat getTimeFormat ()

public TimelineCellView.TimelineTimeState getTimeState ()

public float getTimelineLineWidth ()

public Drawable getTimelineNode ()

public CharSequence getTimestamp ()

Get the timestamp of the cell.

Returns
  • CharSequence

public TimelineCellView.TimelineCellTimestampType getTimestampType ()

public boolean isCardClicked (MotionEvent motionEvent, View view)

public void onInitializeAccessibilityNodeInfo (AccessibilityNodeInfo info)

public void recycle ()

Recycle the view for reuse

public void setAttribute (CharSequence attribute)

Set the attribute of the cell.

An attribute should describe an aspect of the content being viewed.

Parameters
attribute Attribute to set
See Also

public void setAttribute (int resId)

Set the attribute of the cell.

Parameters
resId Resource ID of a string to set as the attribute
See Also

public void setAttributeLines (int lines)

Set the maximum amount of lines available for the attribute.

Parameters
lines Maximum lines available for attribute

public void setAttributeTextAppearance (int resId)

Sets the text color, size, and style of the attribute from the specified TextAppearance resource.

Parameters
resId int

public void setCellType (TimelineCellView.TimelineCellType type)

public void setChronologyBarType (TimelineLineView.LineType type)

Set the type of Chronology Bars. See TimelineLineView.LineType for available Bar types.

Parameters
type TimelineLineView.LineType

public void setDateFormat (String format)

public void setDateFormat (DateFormat format)

public void setDayDateFormat (String format)

public void setDayDateFormat (DateFormat format)

public void setDescription (CharSequence description)

Set the description of the cell.

A description should describe the content being viewed.

Parameters
description Description to set

public void setDescription (int resId)

Set the description of the cell.

Parameters
resId Resource ID of a string to set as the description

public void setDescriptionLines (int lines)

Set the maximum amount of lines available for the description.

Parameters
lines Maximum lines available for description

public void setDueDate (Date startDate, Date endDate)

Set the date range of the cell.

Parameters
startDate start of date range
endDate end of date range
See Also

public void setDueDate (Date dueDate)

Set the due date of the cell.

Parameters
dueDate due date
See Also

public void setEndLine (int color)

public void setEndLine (Drawable endLine)

public void setIsHeaderRtl (boolean isRtl, int parentWidth)

public void setLinePadding (float padding)

public void setLineSize (float lineSize)

public void setMonthFormat (String format)

public void setMonthFormat (DateFormat format)

public void setMonthTextAppearance (int resId)

Sets the text color, size, and style of the month timestamp from the specified TextAppearance resource.

Parameters
resId int

public void setNodeSize (float nodeSize)

public void setOrderType (TimelineCellView.TimelineOrderType type)

public void setShouldDisplayTimestamp (boolean shouldDisplay)

Toggles whether the month and date will be displayed on the side, and allocates space accordingly.

Parameters
shouldDisplay Whether the month and date should be displayed

public void setStartLine (Drawable startLine)

public void setStartLine (int color)

public void setState (TimelineCellView.TimelineCellState state)

Set the state of the Timeline cell

See Also

public void setTimeFormat (DateFormat format)

public void setTimeFormat (String format)

public void setTimeState (TimelineCellView.TimelineTimeState state)

public void setTimelineLineWidth (float width)

public void setTimelineNode (Drawable node)

public void setTimelineNode (Drawable node, int color)

public void setTimelineNodeColor (int color)

public void setTimestampTextAppearance (int resId)

Sets the text color, size, and style of the timestamp from the specified TextAppearance resource.

Parameters
resId int

public void setTimestampType (TimelineCellView.TimelineCellTimestampType type)

public void setTodayColor (int color)

public void setTodayLineColor (int color)

public void setTodayLinePaint (Paint paint)

public void setTodayPaint (Paint paint)

Protected Methods

protected void addSystemView (View v)

Add the given view to the view group

Parameters
v View

protected void configureAttributeLayout ()

protected void configureDescriptionLayout ()

Configures StaticLayoutTextView for description field. Sets up asynchronous rendering when necessary.

protected void configureHeadlineLayout ()

Configures headline layout

protected void configureMonthLayout ()

protected void configureTimestampLayout ()

protected void init ()

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

protected void measureChildConstrained (View child, int parentWidthSpec, int widthUsed, int widthConstraint, int parentHeightSpec, int heightUsed, int heightConstraint)

Measure a child for given length and width constraints

Parameters
child View
parentWidthSpec android.view.View.MeasureSpec
widthUsed int
widthConstraint android.view.ViewGroup.LayoutParams
parentHeightSpec android.view.View.MeasureSpec
heightUsed int
heightConstraint android.view.ViewGroup.LayoutParams

protected void onDraw (Canvas canvas)

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

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)

protected void setMonth (CharSequence month)

Set the month of this cell.

The month to be displayed as the header of a group.

Parameters
month Month to set
See Also

protected void setTimestamp (CharSequence timestamp)

Set the timestamp of this cell.

A timestamp should show the time when the cell's event takes place.

Parameters
timestamp Timestamp to set
See Also