public class

ObjectCell

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

Class Overview

A list item that shows a business object.

Structure

  • Icon Stack
  • A set of up to 3 vertically stacked icons can be displayed on the far left. These icons indicate something about the object, such as its unread status or that it has attachments. See addIcon, clearIconStack, and getIconStack. See setIcon(Drawable, int, CharSequence).

  • Detail Image
  • An image representing the object can be set. See setDetailImage(Drawable).

  • Headline
  • The headline/title is the main area for text content. The title is the only mandatory content for the Object Cell. See setHeadline(int), and getHeadline().

  • Sub headline
  • The sub headline is under headline to show more information. See setSubheadline(int), and getSubheadline().

  • Footnote
  • The footnote is under sub headline and shows further information. See setFootnote(int), and getFootnote().

  • Description
  • If a description has been defined, it will appear in regular mode only. This is typically a longer string of text than what is displayed in the title content. See setDescription(int), and getDescription().

  • Status
  • If an object has an attribute, such as a status, associated with it, it can be displayed on the right, in front of the accessory view. Up to two attributes can be displayed, stacked vertically. The attribute can be in the form of text or icon. See setStatus(Drawable, int, CharSequence), setStatusColor(int, int) and clearStatuses().

    Status view can also be created as child view of ObjectCell. layout_group="STATUS" must be specified for the status view in XML.

     <ObjectCell
         xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
         <ImageView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             app:layout_group="STATUS"
             />
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             app:layout_group="STATUS"
             />
     </ObjectCell>
     
  • Secondary action
  • The secondary action is usually an information disclosure icon, which would bring up a model. It can also be used for actions, such as download. See setSecondaryActionIcon(Drawable) , setSecondaryActionIconDescription(int) and setSecondaryActionOnClickListener(View.OnClickListener).

    To set listener in XML, an android.databinding.BindingMethod is required. E.g.

          @BindingMethods({
             @BindingMethod(type = ObjectCell.class, attribute = "onActionClick", method = "setSecondaryActionOnClickListener"),
          })
     
Sample code in an androidx.recyclerview.widget.RecyclerView.Adapter:

     public void onBindViewHolder(ViewHolder holder,
        int position) {
         BizObject obj = mObjects.get(position);
         ObjectCell cell = holder.objectCell;

         RequestOptions cropOptions = new RequestOptions().circleCrop().placeholder(R.drawable.circle);
         mGlide.load(obj.getDetailmageUri()).apply(cropOptions).into(
            cell.prepareDetailImageView());
         cell.setDetailImageDescription(R.string.avatar);

         cell.setHeadline(obj.getHeadline());
         cell.setSubheadline(obj.getSubHeadline());
         cell.setFootnote(obj.getFootnote());
         cell.setDescription(obj.getDescription());
         cell.setStatus(obj.getPriority().toString(), 0);
         cell.setSecondaryActionIcon(R.drawable.ic_cloud_download_black_24dp);
         cell.setSecondaryActionIconDescription(R.string.download);
         cell.setSecondaryActionOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 ObjectCell parent = (ObjectCell) v.getParent();
                 Toast toast = Toast.makeText(v.getContext(),
                 "Item: " + parent.getHeadline() + " is clicked.",
                 Toast.LENGTH_SHORT);
                 toast.show();
             }
         });
     }
 

Summary

Nested Classes
class ObjectCell.LayoutParams  
XML Attributes
Attribute Name Related Method Description
com.sap.cloud.mobile.fiori:description The description associated with the AbstractEntityCell. 
com.sap.cloud.mobile.fiori:descriptionTextAppearance Text color, typeface, size, and style for footnote. 
com.sap.cloud.mobile.fiori:descriptionWidthPercent The width percentage of description of the total width shared by headline and description

May be a floating point value, such as "1.2". 

com.sap.cloud.mobile.fiori:detailImage The detail image. 
com.sap.cloud.mobile.fiori:detailImageCharacter The placeholder character for the detail image. 
com.sap.cloud.mobile.fiori:detailImageDescription A content description string to describe the appearance of the associated detail image. 
com.sap.cloud.mobile.fiori:dynamicStatusWidth setDynamicStatusWidth(boolean) Whether to use dynamic status width to make efficient use of space when status' width varies a lot from cell to cell. 
com.sap.cloud.mobile.fiori:footnote setFootnote(CharSequence) The footnote associated with the object cell. 
com.sap.cloud.mobile.fiori:footnoteTextAppearance setFootnoteTextAppearance(int) Text color, typeface, size, and style for footnote. 
com.sap.cloud.mobile.fiori:headline The headline associated with the AbstractEntityCell. 
com.sap.cloud.mobile.fiori:headlineLines Makes the headline be exactly this many lines tall. 
com.sap.cloud.mobile.fiori:headlineTextAppearance Text color, typeface, size, and style for headline. 
com.sap.cloud.mobile.fiori:layout_group Specifies which layout group the child view should belong. 
com.sap.cloud.mobile.fiori:lines Total number of lines. 
com.sap.cloud.mobile.fiori:preserveDetailImageSpacing Whether to preserve detail image space when image is null

May be a boolean value, such as "true" or "false". 

com.sap.cloud.mobile.fiori:preserveIconImageContainer setPreserveIconImageContainer(boolean) Whether to preserve icon stack and detail image container spacing

May be a boolean value, such as "true" or "false". 

com.sap.cloud.mobile.fiori:preserveIconStackSpacing setPreserveIconStackSpacing(boolean) Whether to preserve icon stack space when there are no icons

May be a boolean value, such as "true" or "false". 

com.sap.cloud.mobile.fiori:secondaryActionDescription setSecondaryActionIconDescription(CharSequence) A content description string to describe the appearance of the associated secondary action image. 
com.sap.cloud.mobile.fiori:secondaryActionIcon setSecondaryActionIcon(int) The secondary action icon associated with the object cell. 
com.sap.cloud.mobile.fiori:statusWidth setStatusWidth(int) Sets the fixed status width. 
com.sap.cloud.mobile.fiori:subheadline The subheadline associated with the AbstractEntityCell. 
com.sap.cloud.mobile.fiori:subheadlineTextAppearance Text color, typeface, size, and style for subheadline. 
[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 int mDefaultStatusTextColor
protected StaticLayoutTextView mFootnoteTextView
protected List<View> mStatusViews
[Expand]
Inherited Fields
From class com.sap.cloud.mobile.fiori.object.AbstractEntityCell
From class android.view.View
Public Constructors
ObjectCell(Context context)
ObjectCell(Context context, AttributeSet attrs)
ObjectCell(Context context, AttributeSet attrs, int defStyle)
ObjectCell(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void addView(View child, int index, ViewGroup.LayoutParams params)
void clearIcons()
Clears all icon views.
void clearStatuses()
Clears all status views.
ObjectCell.LayoutParams generateLayoutParams(AttributeSet attrs)
int getDefaultIconColor()
Returns the default color for ImageView inside icon stack.
int getDefaultIconLabelColor()
Returns the default color for TextView inside icon stack.
int getDefaultStatusColor()
Returns the default color that can be used for status TextView or ImageView.
CharSequence getFootnote()
Gets the footnote of the object cell.
int getIconColor(int index)
Gets the icon color at the specified index.
View getIconView(int index)
boolean getPreserveIconImageContainer()
Returns whether to preserve the container for icon stack and detail image.
boolean getPreserveIconStackSpacing()
Returns true if to preserve icon stack space even when there is no icon
Drawable getSecondaryActionIcon()
Return the current secondary action icon drawable.
CharSequence getSecondaryActionIconDescription()
Return the description of the object cell's secondary action icon.
int getStatusColor(int index)
Gets the status color at the specified index.
int getStatusWidth()
Returns the fixed status width
boolean isActionTopAlign()
Returns whether the secondary action is top aligned.
boolean isDynamicStatusWidth()
Returns whether to use dynamic status width to make efficient use of space when status' width varies a lot from cell to cell.
void removeView(View view)
void resetCell()
Resets the cell to its initial state (i.e., re-applies all of the styling that was used at the time the cell was constructed).
void setActionTopAlign(boolean actionTopAlign)
Sets whether the secondary action is top aligned.
void setDynamicStatusWidth(boolean dynamicStatusWidth)
Sets whether to use dynamic status width to make efficient use of space when status' width varies a lot from cell to cell.
void setFootnote(int resId)
Sets the footnote of this object cell.
void setFootnote(CharSequence footnote)
Sets the footnote of the object cell.
void setFootnoteTextAppearance(int resId)
Sets the text color, size, style, hint color, and highlight color for footnote from the specified TextAppearance resource.
void setIcon(int resId, int index, int contentDescId)
Sets an icon.
void setIcon(Drawable drawable, int index, CharSequence contentDescription)
Sets an icon.
void setIcon(CharSequence icon, int index)
Sets an icon.
void setIcon(int iconId, int index)
Sets an icon.
void setIconColor(int color, int index)
Sets the icon color
void setPreserveIconImageContainer(boolean preserveIconImageContainer)
Sets whether to preserve the container for icon stack and detail image.
void setPreserveIconStackSpacing(boolean preserveIconStackSpacing)
Preserves spacing for icon stack
void setSecondaryActionIcon(Drawable drawable)
Sets a secondary action icon drawable.
void setSecondaryActionIcon(int resId)
Sets a secondary action icon drawable from a resource id.
void setSecondaryActionIconDescription(int resId)
Set a description of the object cell's secondary action icon.
void setSecondaryActionIconDescription(CharSequence description)
Set a description of the object cell's secondaryActionIcon.
void setSecondaryActionOnClickListener(View.OnClickListener listener)
Set a listener to respond to secondary action icon click event.
void setStatus(CharSequence status, int index)
Sets a status.
void setStatus(int statusId, int index)
Sets a status.
void setStatus(Drawable drawable, int index, CharSequence contentDescription)
Sets a status.
void setStatus(int resId, int index, int contentDescId)
Sets a status.
void setStatusColor(int color, int index)
Sets the status color
void setStatusWidth(int statusWidth)
Sets the fixed status width
Protected Methods
boolean checkLayoutParams(ViewGroup.LayoutParams p)
void checkTextWidth(int textWidth, int descriptionWidth)
Updates footnote StaticLayoutTextViews if width is changed.
void configureDescriptionLayout()
Configures StaticLayoutTextView for description field.
void configureFootnoteLayout()
Configures footnote layout
ObjectCell.LayoutParams generateDefaultLayoutParams()
ObjectCell.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p)
int getFootnoteWidth()
Returns the width for footnote.
boolean isReusingGroupItems()
Returns whether to reuse group items for statuses and icon stack.
int layoutStatus(boolean isRtl, int height, boolean centerAligned, int statusLeft, int statusRight, int statusTop, int statusLimit, int baseline)
Layout status views.
static void measureDynamicStatus(View child, int parentWidthSpec, int widthUsed, int widthConstraint, int parentHeightSpec, int heightUsed, int heightConstraint, int hPadding, int vPadding)
Measures child with optional constraint.
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
int retrieveLines()
Returns number of lines based on content.
[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

com.sap.cloud.mobile.fiori:description

The description associated with the AbstractEntityCell. Next to headline. Only appears in regular mode(tablet)

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

Related Methods

com.sap.cloud.mobile.fiori:descriptionTextAppearance

Text color, typeface, size, and style for footnote. Defaults to secondary_text_default_material_light color. Default style: TextAppearance_Fiori_ObjectCell_Description

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

Related Methods

com.sap.cloud.mobile.fiori:descriptionWidthPercent

The width percentage of description of the total width shared by headline and description

May be a floating point value, such as "1.2".

Related Methods

com.sap.cloud.mobile.fiori:detailImage

The detail image.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

Related Methods

com.sap.cloud.mobile.fiori:detailImageCharacter

The placeholder character for the detail image. No effect if detailImage is not null.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

Related Methods

com.sap.cloud.mobile.fiori:detailImageDescription

A content description string to describe the appearance of the associated detail image.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

Related Methods

com.sap.cloud.mobile.fiori:dynamicStatusWidth

Whether to use dynamic status width to make efficient use of space when status' width varies a lot from cell to cell.

May be a boolean value, such as "true" or "false".

com.sap.cloud.mobile.fiori:footnote

The footnote associated with the object cell. Under subheadline.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

Related Methods

com.sap.cloud.mobile.fiori:footnoteTextAppearance

Text color, typeface, size, and style for footnote. Defaults to secondary_text_default_material_light color. Default style: TextAppearance_Fiori_ObjectCell_Footnote

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

com.sap.cloud.mobile.fiori:headline

The headline associated with the AbstractEntityCell. Mandatory.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

Related Methods

com.sap.cloud.mobile.fiori:headlineLines

Makes the headline be exactly this many lines tall. Default value is 1 if not specified. When it's 2, footnote will disappear; when it's 3, sub headline will also disappear. This must be equal to or less than "lines".

May be an integer value, such as "100".

Related Methods

com.sap.cloud.mobile.fiori:headlineTextAppearance

Text color, typeface, size, and style for headline. Defaults to material_grey_900 color. Default style: TextAppearance_Fiori_ObjectCell_Headline

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

Related Methods

com.sap.cloud.mobile.fiori:layout_group

Specifies which layout group the child view should belong. This must be set for any child views of an ObjectCell, otherwise the view will be ignored.

Must be one of the following constant values.

ConstantValueDescription
ICON_STACK2Designates a view to show in ObjectCell icon stack group
INTERNAL0Reserved for internal usage
STATUS1Designates a view to show in ObjectCell status group. This is the default if not specified.

Related Methods

com.sap.cloud.mobile.fiori:lines

Total number of lines.

May be an integer value, such as "100".

Related Methods

com.sap.cloud.mobile.fiori:preserveDetailImageSpacing

Whether to preserve detail image space when image is null

May be a boolean value, such as "true" or "false".

Related Methods

com.sap.cloud.mobile.fiori:preserveIconImageContainer

Whether to preserve icon stack and detail image container spacing

May be a boolean value, such as "true" or "false".

com.sap.cloud.mobile.fiori:preserveIconStackSpacing

Whether to preserve icon stack space when there are no icons

May be a boolean value, such as "true" or "false".

com.sap.cloud.mobile.fiori:secondaryActionDescription

A content description string to describe the appearance of the associated secondary action image.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

com.sap.cloud.mobile.fiori:secondaryActionIcon

The secondary action icon associated with the object cell.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

Related Methods

com.sap.cloud.mobile.fiori:statusWidth

Sets the fixed status width.

May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related Methods

com.sap.cloud.mobile.fiori:subheadline

The subheadline associated with the AbstractEntityCell. Under headline.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

Related Methods

com.sap.cloud.mobile.fiori:subheadlineTextAppearance

Text color, typeface, size, and style for subheadline. Defaults to primary_text_default_material_light color. Default style: TextAppearance_Fiori_ObjectCell_Subheadline

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

Related Methods

Fields

protected int mDefaultStatusTextColor

protected StaticLayoutTextView mFootnoteTextView

protected List<View> mStatusViews

Public Constructors

public ObjectCell (Context context)

public ObjectCell (Context context, AttributeSet attrs)

public ObjectCell (Context context, AttributeSet attrs, int defStyle)

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

Public Methods

public void addView (View child, int index, ViewGroup.LayoutParams params)

public void clearIcons ()

Clears all icon views. It should be called before it's reused in list if there are items with no or fewer icon field than other items. Icon colors will also be cleared.

public void clearStatuses ()

Clears all status views. It should be called before it's reused in list if there are items with no or fewer status field than other items. Status colors will also be cleared.

public ObjectCell.LayoutParams generateLayoutParams (AttributeSet attrs)

public int getDefaultIconColor ()

Returns the default color for ImageView inside icon stack.

public int getDefaultIconLabelColor ()

Returns the default color for TextView inside icon stack.

public int getDefaultStatusColor ()

Returns the default color that can be used for status TextView or ImageView.

public CharSequence getFootnote ()

Gets the footnote of the object cell.

Related XML Attributes
Returns
  • The footnote.

public int getIconColor (int index)

Gets the icon color at the specified index. It can only retrieve the value explicitly set by setIconColor(int, int). TextColor or image tint specified in XML would not be retrieved.

Parameters
index icon index: 0, 1, or 2
Returns
  • color

public View getIconView (int index)

public boolean getPreserveIconImageContainer ()

Returns whether to preserve the container for icon stack and detail image.

public boolean getPreserveIconStackSpacing ()

Returns true if to preserve icon stack space even when there is no icon

public Drawable getSecondaryActionIcon ()

Return the current secondary action icon drawable.

Returns
  • The current secondary action icon drawable

public CharSequence getSecondaryActionIconDescription ()

Return the description of the object cell's secondary action icon.

Returns
  • A description of the secondary action icon

public int getStatusColor (int index)

Gets the status color at the specified index. It can only retrieve the value explicitly set by setStatusColor(int, int). TextColor or image tint specified in XML would not be retrieved.

Parameters
index status index: 0 or 1
Returns
  • color

public int getStatusWidth ()

Returns the fixed status width

public boolean isActionTopAlign ()

Returns whether the secondary action is top aligned.

public boolean isDynamicStatusWidth ()

Returns whether to use dynamic status width to make efficient use of space when status' width varies a lot from cell to cell.

public void removeView (View view)

public void resetCell ()

Resets the cell to its initial state (i.e., re-applies all of the styling that was used at the time the cell was constructed).

public void setActionTopAlign (boolean actionTopAlign)

Sets whether the secondary action is top aligned. Default is false. Note that status views will be using the same alignment as secondary action. If secondary action is not set, this setting does not change anything, and status views will be top aligned by default.

public void setDynamicStatusWidth (boolean dynamicStatusWidth)

Sets whether to use dynamic status width to make efficient use of space when status' width varies a lot from cell to cell. Once it's set to true getStatusWidth() will be ignored.

public void setFootnote (int resId)

Sets the footnote of this object cell.

Footnote can be used in addition to subheadline.

Related XML Attributes
Parameters
resId String resource ID

public void setFootnote (CharSequence footnote)

Sets the footnote of the object cell.

Footnote can be used in addition to subheadline.

Related XML Attributes
Parameters
footnote The footnote.

public void setFootnoteTextAppearance (int resId)

Sets the text color, size, style, hint color, and highlight color for footnote from the specified TextAppearance resource.

public void setIcon (int resId, int index, int contentDescId)

Sets an icon. It's recommended that icon view type at the same index for each row is consistent.

Parameters
resId icon resource id
index 0, 1 or 2. Always sets icon starting from 0.
contentDescId content description id

public void setIcon (Drawable drawable, int index, CharSequence contentDescription)

Sets an icon. It's recommended that icon view type at the same index for each row is consistent.

Parameters
drawable icon
index 0, 1 or 2. Always sets icon starting from 0.

public void setIcon (CharSequence icon, int index)

Sets an icon. It's recommended that icon view type at the same index for each row is consistent.

Parameters
icon text to shown as icon
index 0, 1 or 2, Always sets icon starting from 0.

public void setIcon (int iconId, int index)

Sets an icon. It's recommended that icon view type at the same index for each row is consistent.

Parameters
iconId String id to shown as icon
index 0, 1 or 2, Always sets icon starting from 0.

public void setIconColor (int color, int index)

Sets the icon color

Parameters
color color value. 0 means not specified so that color is set by the view itself. Otherwise the supplied value will overwrite the color specified on the view. Recommend getDefaultIconColor() and getDefaultIconLabelColor() if there is no special requirement.
index status field index

public void setPreserveIconImageContainer (boolean preserveIconImageContainer)

Sets whether to preserve the container for icon stack and detail image. When this flag is set to true, getPreserveIconStackSpacing() and getPreserveDetailImageSpacing() will be ignored. Inside the container, if either icon stack or detail image is missing, the other view will be right aligned.

public void setPreserveIconStackSpacing (boolean preserveIconStackSpacing)

Preserves spacing for icon stack

public void setSecondaryActionIcon (Drawable drawable)

Sets a secondary action icon drawable.

This drawable takes the place at the end of the object cell. Apps using a secondary action icon should also supply a description using setSecondaryActionIconDescription(int).

Parameters
drawable Drawable to use as a secondary action icon

public void setSecondaryActionIcon (int resId)

Sets a secondary action icon drawable from a resource id.

This drawable takes the place at the end of the object cell. Apps using a secondary action icon should also supply a description using setSecondaryActionIconDescription(int).

Parameters
resId ID of a drawable resource

public void setSecondaryActionIconDescription (int resId)

Set a description of the object cell's secondary action icon.

This description will be used for accessibility or other similar descriptions of the UI.

Parameters
resId String resource id

public void setSecondaryActionIconDescription (CharSequence description)

Set a description of the object cell's secondaryActionIcon.

This description will be used for accessibility or other similar descriptions of the UI.

Parameters
description Description to set

public void setSecondaryActionOnClickListener (View.OnClickListener listener)

Set a listener to respond to secondary action icon click event.

This listener will be called whenever the user clicks the secondary action button at the end of the object cell. An icon must be set for the secondary action button to appear.

Parameters
listener Listener to set

public void setStatus (CharSequence status, int index)

Sets a status. It's recommended that status view type at the same index for each row is consistent.

Parameters
status text to shown as status
index 0 or 1. Always sets status starting from 0.

public void setStatus (int statusId, int index)

Sets a status. It's recommended that status view type at the same index for each row is consistent.

Parameters
statusId String id to shown as status
index 0 or 1. Always sets status starting from 0.

public void setStatus (Drawable drawable, int index, CharSequence contentDescription)

Sets a status. It's recommended that status view type at the same index for each row is consistent.

Parameters
drawable icon
index 0 or 1. Always sets status starting from 0.

public void setStatus (int resId, int index, int contentDescId)

Sets a status. It's recommended that status view type at the same index for each row is consistent.

Parameters
resId icon resource id
index 0 or 1. Always sets status starting from 0.
contentDescId content description id

public void setStatusColor (int color, int index)

Sets the status color

Parameters
color color value. 0 means not specified so that color is set by the view itself. Otherwise the supplied value will overwrite the color specified on the view. Recommend getDefaultStatusColor() if there is no special requirement.
index status field index

public void setStatusWidth (int statusWidth)

Sets the fixed status width

Protected Methods

protected boolean checkLayoutParams (ViewGroup.LayoutParams p)

protected void checkTextWidth (int textWidth, int descriptionWidth)

Updates footnote StaticLayoutTextViews if width is changed. Important! Don't call requestLayout() here since it's called from onMeasure.

Parameters
textWidth whole text width
descriptionWidth width that COULD be used by description

protected void configureDescriptionLayout ()

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

protected void configureFootnoteLayout ()

Configures footnote layout

protected ObjectCell.LayoutParams generateDefaultLayoutParams ()

protected ObjectCell.LayoutParams generateLayoutParams (ViewGroup.LayoutParams p)

protected int getFootnoteWidth ()

Returns the width for footnote.

protected boolean isReusingGroupItems ()

Returns whether to reuse group items for statuses and icon stack.

protected int layoutStatus (boolean isRtl, int height, boolean centerAligned, int statusLeft, int statusRight, int statusTop, int statusLimit, int baseline)

Layout status views. Returns the bottom of the layout

protected static void measureDynamicStatus (View child, int parentWidthSpec, int widthUsed, int widthConstraint, int parentHeightSpec, int heightUsed, int heightConstraint, int hPadding, int vPadding)

Measures child with optional constraint.

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

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)

protected int retrieveLines ()

Returns number of lines based on content. To be overwritten by subclasses.