public abstract class

AbstractEntityCell

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

Class Overview

Abstract base class for views to show detail image, headline, subheadline, and description. Subclasses should implement onMeasure and onLayout to fulfill the layout requirement.

Summary

Nested Classes
class AbstractEntityCell.GroupLayoutParams Layout information for child views of AbstractEntityCells. 
@interface AbstractEntityCell.ImageShape  
XML Attributes
Attribute Name Related Method Description
AbstractEntityCell_asyncRendering setAsyncRendering(boolean)  
AbstractEntityCell_description setDescription(CharSequence)  
AbstractEntityCell_descriptionTextAppearance setDescriptionTextAppearance(int)  
AbstractEntityCell_descriptionWidthPercent setDescriptionWidthPercent(float)  
AbstractEntityCell_detailImage setDetailImage(int)  
AbstractEntityCell_detailImageCharacter setDetailImageCharacter(CharSequence)  
AbstractEntityCell_detailImageDescription setDetailImageDescription(int)  
AbstractEntityCell_headline setHeadline(int)  
AbstractEntityCell_headlineLines setHeadlineLines(int)  
AbstractEntityCell_headlineTextAppearance setHeadlineTextAppearance(int)  
AbstractEntityCell_lines setLines(int)  
AbstractEntityCell_preserveDescriptionSpacing setPreserveDescriptionSpacing(boolean)  
AbstractEntityCell_preserveDetailImageSpacing setPreserveDetailImageSpacing(boolean)  
AbstractEntityCell_subheadline setSubheadline(CharSequence)  
AbstractEntityCell_subheadlineLines setSubheadlineLines(int)  
AbstractEntityCell_subheadlineTextAppearance setSubheadlineTextAppearance(int)  
Constants
String HEADLINE_PLACEHOLDER Placeholder for headline when nothing is specified
int IMAGE_SHAPE_OVAL Oval image shape.
int IMAGE_SHAPE_RECTANGLE Rectangle image shape.
int IMAGE_SHAPE_ROUND_RECT Rounded corner rectangle image shape.
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
Fields
public static final char[] ELLIPSIS_NORMAL "..."
public static final String ELLIPSIS_STRING
protected boolean mAsyncRendering
protected FioriAvatarStack mAvatarGrid
protected FioriAvatarStack mAvatarStack
protected Drawable mBackgroundDrawable
protected Drawable mBackgroundSelected
protected int mCachedPaddingStart
protected Drawable mCheckIconDrawable
protected CharSequence mDescription
protected float mDescriptionHeight
protected StaticLayout mDescriptionLayout
protected TextPaint mDescriptionPaint
protected int mDescriptionTextAppearance
protected StaticLayoutTextView mDescriptionTextView
protected int mDescriptionWidth
protected float mDescriptionWidthPercent
protected CharSequence mDetailImageCharacter
protected CharSequence mDetailImageDescription
protected ProgressBar mDetailProgressBar
protected float mFootnoteHeight
protected CharSequence mHeadline
protected float mHeadlineHeight
protected StaticLayout mHeadlineLayout
protected int mHeadlineLines
protected int mHeadlinePaddingBottom
protected TextPaint mHeadlinePaint
protected int mHeadlineTextAppearance
protected StaticLayoutTextView mHeadlineTextView
protected int mHeight
protected boolean mHideAvatar
protected int mIconSize
protected int mImageOutlineShape
protected int mImageSize
protected int mImageWidthWithMargin
protected boolean mIsRead
protected boolean mIsReadStateEnabled
protected boolean mIsSelected
protected boolean mIsTablet
protected int mLargeMargin
protected int mLines
protected int mMediumMargin
protected int mMinTouchSize
protected Drawable mOriginalDetailImageDrawable
protected boolean mPreserveDetailImageSpacing
protected int mSmallIconSize
protected int mSmallMargin
protected int mSmallerMargin
protected float mSubHeadlineHeight
protected int mSubHeadlinePaddingBottom
protected CharSequence mSubheadline
protected StaticLayout mSubheadlineLayout
protected int mSubheadlineLines
protected TextPaint mSubheadlinePaint
protected int mSubheadlineTextAppearance
protected StaticLayoutTextView mSubheadlineTextView
protected int mTinyMargin
protected int mTitleWidth
protected static CharSequence sLoading
protected static ViewOutlineProvider sOvalOutlineProvider
protected static ViewOutlineProvider sRoundRectOutlineProvider
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
AbstractEntityCell(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
AbstractEntityCell.GroupLayoutParams generateLayoutParams(AttributeSet attrs)
FioriAvatarStack getAvatarGrid()
FioriAvatarStack getAvatarStack()
CharSequence getDescription()
Gets the description of the object cell.
float getDescriptionWidthPercent()
Gets description width percentage in the space shared by headline and description.
Drawable getDetailImage()
Return the current detail image drawable.
Drawable getDetailImageBadge()
ImageView getDetailImageBadgeView()
CharSequence getDetailImageCharacter()
Returns the character as placeholder of the detail image.
CharSequence getDetailImageDescription()
Return the description of the object cell's detail image.
ImageView getDetailImageView()
Gets the detail image view.
ProgressBar getDetailProgressBar()
Gets the detail progress bar.
CharSequence getHeadline()
Gets the headline of the object cell.
int getHeadlineLines()
Gets the number of lines of headline text view
int getImageOutlineShape()
Returns the detail image outline shape.
boolean getIsRead()
Return boolean mIsRead, whether the cell is read.
boolean getIsReadStateEnabled()
Return whether the cell's read state affects the cell's appearance.
boolean getIsSelected()
Return boolean mIsSelected, whether the cell is selected.
int getKeylineStart()
Returns the starting position of the headline text.
int getLines()
Gets the total of lines
boolean getPreserveDescriptionSpacing()
Returns true if to preserve description spacing even when description is null
boolean getPreserveDetailImageSpacing()
Returns true if to preserve detail image space even when image is null
CharSequence getSubheadline()
Gets the subheadline of the object cell.
int getSubheadlineLines()
Gets the number of lines of subheadline text view
void hideDetailImageView()
Hide the detail image view (and the detail image text view).
void hideDetailProgressBar()
Hide the detail progress bar view by removing it from the view group.
boolean isAsyncRendering()
Returns whether the description content will be rendered asynchronously.
ImageView prepareDetailImageView()
Gets the detail image 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 setAsyncRendering(boolean asyncRendering)
Sets whether the description content will be rendered asynchronously.
void setAvatarGrid(List<FioriAvatar> grid)
void setAvatarGrid(int index, Drawable drawable)
void setAvatarGrid(int index, int resId)
void setAvatarGridMax(int max)
void setAvatarStack(List<FioriAvatar> stack)
void setBackgroundDefault(Drawable background)
Set the background drawable when the cell is in its normal state, i.e.
void setBackgroundSelected(Drawable background)
Set the background drawable when the cell is being selected.
void setCheckIcon(int resId)
Set the icon drawable that replaces the detail image when the cell is in its selected state.
void setCheckIcon(Drawable icon)
Set the icon drawable that replaces the detail image when the cell is in its selected state.
void setDescription(int resId)
Sets the description of the object cell.
void setDescription(CharSequence description)
Sets the description of the object cell.
void setDescriptionColor(int color)
Sets the text color for description.
void setDescriptionFont(Typeface font)
Sets the text font for description.
void setDescriptionFont(int fontId)
Sets the text font for description.
void setDescriptionSize(float size)
Sets the text size for description.
void setDescriptionTextAppearance(int resId)
Sets the text color, size, style, hint color, and highlight color for description from the specified TextAppearance resource.
void setDescriptionWidthPercent(float descriptionWidthPercent)
Sets the description width percentage in the space shared by headline and description.
void setDetailImage(Drawable drawable)
Sets a detailImage drawable.
void setDetailImage(int index, Drawable drawable)
void setDetailImage(int index, int resId)
void setDetailImage(int resId)
Sets a detail image drawable from a resource id.
void setDetailImageBadge(Drawable drawable)
void setDetailImageBadge(int resId)
void setDetailImageBadgeSize(int size)
void setDetailImageCharacter(CharSequence character)
Sets the character as placeholder of the detail image.
void setDetailImageColor(int color)
void setDetailImageDescription(CharSequence description)
Set a description of the object cell's detailImage.
void setDetailImageDescription(int resId)
Set a description of the object cell's detail image.
void setDetailImageTextColor(int color)
void setHeadline(CharSequence headline)
Sets the headline of the object cell.
void setHeadline(int resId)
Sets the headline of the object cell.
void setHeadlineColor(int color)
Sets the text color for headline.
void setHeadlineFont(Typeface font)
Sets the text font for headline.
void setHeadlineFont(int fontId)
Sets the text font for headline.
void setHeadlineLines(int headlineLines)
Sets the number of lines of headline text view
void setHeadlineSize(float size)
Sets the text size for headline.
void setHeadlineTextAppearance(int resId)
Sets the text color, size, style, hint color, and highlight color for headline from the specified TextAppearance resource.
void setImageOutlineShape(int imageOutlineShape)
Sets the detail image outline shape.
void setImageSize(int size)
void setIsRead(boolean isRead)
Set mIsRead boolean whether the cell is read.
void setIsReadStateEnabled(boolean isEnabled)
Set whether the headline text appearance and unread indicator's visibility changes depending on the cell's read state.
void setIsSelected(boolean isSelected)
Set mIsSelected boolean whether the cell is selected.
void setLines(int lines)
Sets the total number of lines
void setMaxProgress(int maxProgress)
Set maximum progress value on the detail progress bar view.
void setPreserveDescriptionSpacing(boolean preserveDescriptionSpacing)
Preserves spacing for description
void setPreserveDetailImageSpacing(boolean preserveDetailImageSpacing)
Preserves spacing for detail image
void setProgress(int progress)
Set progress value on the detail progress bar view.
void setSubheadline(int resId)
Set the subheadline of this object cell.
void setSubheadline(CharSequence subheadline)
Sets the subheadline of the object cell.
void setSubheadlineColor(int color)
Sets the text color for subheadline.
void setSubheadlineFont(Typeface font)
Sets the text font for subheadline.
void setSubheadlineFont(int fontId)
Sets the text font for subheadline.
void setSubheadlineLines(int subheadlineLines)
Sets the number of lines of subheadline text view
void setSubheadlineSize(float size)
Sets the text size for subheadline.
void setSubheadlineTextAppearance(int resId)
Sets the text color, size, style, hint color, and highlight color for subheadline from the specified TextAppearance resource.
void setUseBorder(boolean useBorder)
void setUseCutOut(boolean useCutOut)
void setUseIcon(boolean useIcon)
void showDetailImageView()
Show the detail image view (and the detail image text view).
ProgressBar showDetailProgressBar()
Configure the detail progress bar view and add it to the view group.
void updateUiOnRead()
Update UI depending on the isRead status of the AbstractEntityCell If the cell is read, the headline text appearance should be using SubheadlineTextAppearance.
void updateUiOnSelected()
Update UI depending on the isSelected status of the AbstractEntityCell.
Protected Methods
void addSystemView(View v)
Adds internal child views.
void addViewToGroup(View v, int group)
Adds the view into specified group.
static int adjustMeasureSpec(int childSpec, int constraint)
Converts child measurement into EXACTLY if possible.
int calculateDynamicHeight(int lines)
boolean checkLayoutParams(ViewGroup.LayoutParams p)
void checkTextWidth(int textWidth, int descriptionWidth)
Updates StaticLayoutTextViews if width is changed.
void configureDescriptionLayout()
Configures StaticLayoutTextView for description field.
void configureHeadlineLayout()
Configures headline layout
void configureSubheadlineLayout()
Configures sub headline layout
TextPaint createTextPaint(int resId)
Creates TextPaint from the given resource id
void doSetDescription(CharSequence description)
Sets description.
void ensureAvatarGrid()
void ensureDetailImageView()
void ensureDetailProgressBar()
AbstractEntityCell.GroupLayoutParams generateDefaultLayoutParams()
AbstractEntityCell.GroupLayoutParams generateLayoutParams(ViewGroup.LayoutParams p)
int getDefaultLines()
Returns the default lines supported by this cell.
int getDescriptionWidth()
Returns the width for description.
int getHeadlineLayoutLines()
Returns the real lines used by headline.
int getHeadlineMaxLines()
Returns the maximum lines of headline
int getHorizontalMargins(View v)
Gets horizontal margin from layout params
int getLayoutLines()
Returns fixed lines or if setLines(0) was used, returns number of lines based on content.
int getMaxLines()
Returns the max number of lines supported by this cell.
int getRemainedDescriptionWidth(int parentWidthSpec, int endWidthUsed)
Calculates how much width is left for headline if description is present
int getRemainedWidth(int parentWidthSpec, int widthUsed)
Calculates how much width is left
TextDirectionHeuristic getTextDirectionHeuristic()
Returns the current TextDirectionHeuristic.
Layout.Alignment getTextLayoutAlignment()
Determines how the text should be laid out.
int getTitleWidth()
Returns the width for title area, including headline and subheadline.
int getVerticalMargins(View v)
Gets vertical margin from layout params
boolean isChild(View child)
Tests whether the given view is a child view
boolean loadingDescription()
static void measureChildConstrained(View child, int parentWidthSpec, int widthUsed, int widthConstraint, int parentHeightSpec, int heightUsed, int heightConstraint, int hPadding, int vPadding)
Measures child with optional constraint.
void measureChildFixed(View child, int width, int height)
Measures child view with fixed width and height
void measureChildFixed(View child, int width, int height, boolean touchable)
Measures child view with fixed width and height.
void measureTextLayout(StaticLayoutTextView child, int width)
Measures the text view with the given width
StaticLayout obtainStaticLayout(CharSequence text, TextPaint paint, int width, int lines, float lineHeight)
Creates a new StaticLayout based on the parameters
int retrieveLines()
Returns number of lines based on content.
StaticLayoutTextView setTextView(StaticLayoutTextView textView, StaticLayout layout)
Sets the StaticLayout to the view and returns the text view.
boolean shouldLayout(View view)
Returns whether the given view should be laid out, which means it's a child and is visible.
boolean shouldLayout(List<? extends View> views)
Returns true is any item in the given list should be laid out
[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
From interface com.sap.cloud.mobile.fiori.object.KeylineProvider

XML Attributes

AbstractEntityCell_asyncRendering

Related Methods

AbstractEntityCell_description

AbstractEntityCell_descriptionTextAppearance

AbstractEntityCell_descriptionWidthPercent

AbstractEntityCell_detailImage

Related Methods

AbstractEntityCell_detailImageCharacter

AbstractEntityCell_detailImageDescription

AbstractEntityCell_headline

Related Methods

AbstractEntityCell_headlineLines

Related Methods

AbstractEntityCell_headlineTextAppearance

AbstractEntityCell_lines

Related Methods

AbstractEntityCell_preserveDescriptionSpacing

AbstractEntityCell_preserveDetailImageSpacing

AbstractEntityCell_subheadline

AbstractEntityCell_subheadlineLines

Related Methods

AbstractEntityCell_subheadlineTextAppearance

Constants

public static final String HEADLINE_PLACEHOLDER

Placeholder for headline when nothing is specified

Constant Value: "__"

public static final int IMAGE_SHAPE_OVAL

Oval image shape. Used for people.

Constant Value: 1 (0x00000001)

public static final int IMAGE_SHAPE_RECTANGLE

Rectangle image shape. Used for objects.

Constant Value: 0 (0x00000000)

public static final int IMAGE_SHAPE_ROUND_RECT

Rounded corner rectangle image shape. Used for objects.

Constant Value: 2 (0x00000002)

Fields

public static final char[] ELLIPSIS_NORMAL

"..."

public static final String ELLIPSIS_STRING

protected boolean mAsyncRendering

protected FioriAvatarStack mAvatarGrid

protected FioriAvatarStack mAvatarStack

protected Drawable mBackgroundDrawable

protected Drawable mBackgroundSelected

protected int mCachedPaddingStart

protected Drawable mCheckIconDrawable

protected CharSequence mDescription

protected float mDescriptionHeight

protected StaticLayout mDescriptionLayout

protected TextPaint mDescriptionPaint

protected int mDescriptionTextAppearance

protected StaticLayoutTextView mDescriptionTextView

protected int mDescriptionWidth

protected float mDescriptionWidthPercent

protected CharSequence mDetailImageCharacter

protected CharSequence mDetailImageDescription

protected ProgressBar mDetailProgressBar

protected float mFootnoteHeight

protected CharSequence mHeadline

protected float mHeadlineHeight

protected StaticLayout mHeadlineLayout

protected int mHeadlineLines

protected int mHeadlinePaddingBottom

protected TextPaint mHeadlinePaint

protected int mHeadlineTextAppearance

protected StaticLayoutTextView mHeadlineTextView

protected int mHeight

protected boolean mHideAvatar

protected int mIconSize

protected int mImageOutlineShape

protected int mImageSize

protected int mImageWidthWithMargin

protected boolean mIsRead

protected boolean mIsReadStateEnabled

protected boolean mIsSelected

protected boolean mIsTablet

protected int mLargeMargin

protected int mLines

protected int mMediumMargin

protected int mMinTouchSize

protected Drawable mOriginalDetailImageDrawable

protected boolean mPreserveDetailImageSpacing

protected int mSmallIconSize

protected int mSmallMargin

protected int mSmallerMargin

protected float mSubHeadlineHeight

protected int mSubHeadlinePaddingBottom

protected CharSequence mSubheadline

protected StaticLayout mSubheadlineLayout

protected int mSubheadlineLines

protected TextPaint mSubheadlinePaint

protected int mSubheadlineTextAppearance

protected StaticLayoutTextView mSubheadlineTextView

protected int mTinyMargin

protected int mTitleWidth

protected static CharSequence sLoading

protected static ViewOutlineProvider sOvalOutlineProvider

protected static ViewOutlineProvider sRoundRectOutlineProvider

Public Constructors

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

Public Methods

public AbstractEntityCell.GroupLayoutParams generateLayoutParams (AttributeSet attrs)

public FioriAvatarStack getAvatarGrid ()

public FioriAvatarStack getAvatarStack ()

public CharSequence getDescription ()

Gets the description of the object cell.

Related XML Attributes
Returns
  • The description.

public float getDescriptionWidthPercent ()

Gets description width percentage in the space shared by headline and description.

Returns
  • The description width percentage.

public Drawable getDetailImage ()

Return the current detail image drawable.

Related XML Attributes
Returns
  • The current detail image drawable

public Drawable getDetailImageBadge ()

public ImageView getDetailImageBadgeView ()

public CharSequence getDetailImageCharacter ()

Returns the character as placeholder of the detail image.

public CharSequence getDetailImageDescription ()

Return the description of the object cell's detail image.

Returns
  • A description of the detail image

public ImageView getDetailImageView ()

Gets the detail image view.

Related XML Attributes
Returns
  • detail image view, could be null

public ProgressBar getDetailProgressBar ()

Gets the detail progress bar.

Returns
  • detail progress bar, could be null

public CharSequence getHeadline ()

Gets the headline of the object cell.

Related XML Attributes
Returns
  • The headline.

public int getHeadlineLines ()

Gets the number of lines of headline text view

Related XML Attributes

public int getImageOutlineShape ()

Returns the detail image outline shape.

public boolean getIsRead ()

Return boolean mIsRead, whether the cell is read.

Returns
  • mIsRead

public boolean getIsReadStateEnabled ()

Return whether the cell's read state affects the cell's appearance.

Returns
  • mIsReadStateEnabled

public boolean getIsSelected ()

Return boolean mIsSelected, whether the cell is selected.

Returns
  • mIsSelected

public int getKeylineStart ()

Returns the starting position of the headline text. This can be used as key line to determine divider line position, etc.

Returns
  • start (left/right) position of headline text based on layout direction.

public int getLines ()

Gets the total of lines

Related XML Attributes

public boolean getPreserveDescriptionSpacing ()

Returns true if to preserve description spacing even when description is null

public boolean getPreserveDetailImageSpacing ()

Returns true if to preserve detail image space even when image is null

public CharSequence getSubheadline ()

Gets the subheadline of the object cell.

Related XML Attributes
Returns
  • The subheadline.

public int getSubheadlineLines ()

Gets the number of lines of subheadline text view

Related XML Attributes

public void hideDetailImageView ()

Hide the detail image view (and the detail image text view). Use case includes: while the detail progress bar is displayed.

public void hideDetailProgressBar ()

Hide the detail progress bar view by removing it from the view group.

public boolean isAsyncRendering ()

Returns whether the description content will be rendered asynchronously.

Related XML Attributes

public ImageView prepareDetailImageView ()

Gets the detail image view. Creates it if necessary. This can be used together with libraries like Glide.

Returns
  • detail image 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 setAsyncRendering (boolean asyncRendering)

Sets whether the description content will be rendered asynchronously. Long text rendering is expensive, so for a smooth scroll this mode should be set to true.

Related XML Attributes

public void setAvatarGrid (List<FioriAvatar> grid)

public void setAvatarGrid (int index, Drawable drawable)

public void setAvatarGrid (int index, int resId)

public void setAvatarGridMax (int max)

public void setAvatarStack (List<FioriAvatar> stack)

public void setBackgroundDefault (Drawable background)

Set the background drawable when the cell is in its normal state, i.e. not selected.

Parameters
background drawable to be used as the background when the cell is in its normal state

public void setBackgroundSelected (Drawable background)

Set the background drawable when the cell is being selected.

Parameters
background drawable to be used as the background when the cell is selected

public void setCheckIcon (int resId)

Set the icon drawable that replaces the detail image when the cell is in its selected state.

Parameters
resId resource id for drawable to be used as the detail image when the cell is in its selected state

public void setCheckIcon (Drawable icon)

Set the icon drawable that replaces the detail image when the cell is in its selected state.

Parameters
icon drawable to be used as the detail image when the cell is in its selected state

public void setDescription (int resId)

Sets the description of the object cell. Only visible in regular mode.

Description is typically a longer string of text.

Related XML Attributes
Parameters
resId String resource ID

public void setDescription (CharSequence description)

Sets the description of the object cell. Only visible in regular mode. Ignores input on a phone.

Description is typically a longer string of text.

Related XML Attributes
Parameters
description The description.

public void setDescriptionColor (int color)

Sets the text color for description.

public void setDescriptionFont (Typeface font)

Sets the text font for description.

public void setDescriptionFont (int fontId)

Sets the text font for description.

public void setDescriptionSize (float size)

Sets the text size for description.

public void setDescriptionTextAppearance (int resId)

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

public void setDescriptionWidthPercent (float descriptionWidthPercent)

Sets the description width percentage in the space shared by headline and description. Only used when in regular( tablet) mode and description is available.

Parameters
descriptionWidthPercent The description width percentage.

public void setDetailImage (Drawable drawable)

Sets a detailImage drawable.

This drawable takes the place before headline. The detail image cannot be clicked. Apps using a detail image should also supply a description using setDetailImageDescription(int).

Related XML Attributes
Parameters
drawable Drawable to use as a detail image

public void setDetailImage (int index, Drawable drawable)

public void setDetailImage (int index, int resId)

public void setDetailImage (int resId)

Sets a detail image drawable from a resource id.

This drawable takes the place before headline. The detail image cannot be clicked. Apps using a detail image should also supply a description using setDetailImageDescription(int).

Related XML Attributes
Parameters
resId ID of a drawable resource

public void setDetailImageBadge (Drawable drawable)

public void setDetailImageBadge (int resId)

public void setDetailImageBadgeSize (int size)

public void setDetailImageCharacter (CharSequence character)

Sets the character as placeholder of the detail image.

Parameters
character character to display. One character is recommended.

public void setDetailImageColor (int color)

public void setDetailImageDescription (CharSequence description)

Set a description of the object cell's detailImage.

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

Parameters
description Description to set

public void setDetailImageDescription (int resId)

Set a description of the object cell's detail image.

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

Parameters
resId String resource id

public void setDetailImageTextColor (int color)

public void setHeadline (CharSequence headline)

Sets the headline of the object cell. The headline is always shown. If nothing is specified, HEADLINE_PLACEHOLDER will be displayed.

A headline should be used as the anchor for a section of content. It should describe or name the content being viewed.

Related XML Attributes
Parameters
headline The headline.

public void setHeadline (int resId)

Sets the headline of the object cell. The headline is always shown.

A headline should be used as the anchor for a section of content. It should describe or name the content being viewed.

Related XML Attributes
Parameters
resId Resource ID of a string to set as the headline

public void setHeadlineColor (int color)

Sets the text color for headline.

public void setHeadlineFont (Typeface font)

Sets the text font for headline.

public void setHeadlineFont (int fontId)

Sets the text font for headline.

public void setHeadlineLines (int headlineLines)

Sets the number of lines of headline text view

Related XML Attributes
Parameters
headlineLines line number, must be 0, 1, 2 or 3 and less than getLines(). Dynamic layout can be achieved by setting it to 0 with performance trade-off. Subclass may choose to customize it.

public void setHeadlineSize (float size)

Sets the text size for headline.

public void setHeadlineTextAppearance (int resId)

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

public void setImageOutlineShape (int imageOutlineShape)

Sets the detail image outline shape.

public void setImageSize (int size)

public void setIsRead (boolean isRead)

Set mIsRead boolean whether the cell is read.

public void setIsReadStateEnabled (boolean isEnabled)

Set whether the headline text appearance and unread indicator's visibility changes depending on the cell's read state.

Parameters
isEnabled True enables the cell's appearance to change depending on the read state

public void setIsSelected (boolean isSelected)

Set mIsSelected boolean whether the cell is selected.

public void setLines (int lines)

Sets the total number of lines

Related XML Attributes
Parameters
lines cell lines, could be 1 to getMaxLines() for fixed number or 0 for dynamic layout

public void setMaxProgress (int maxProgress)

Set maximum progress value on the detail progress bar view.

Parameters
maxProgress int value of the maximum progress.

public void setPreserveDescriptionSpacing (boolean preserveDescriptionSpacing)

Preserves spacing for description

public void setPreserveDetailImageSpacing (boolean preserveDetailImageSpacing)

Preserves spacing for detail image

public void setProgress (int progress)

Set progress value on the detail progress bar view.

Parameters
progress int value of the progress.

public void setSubheadline (int resId)

Set the subheadline of this object cell.

Subheadline should express extended information about the current content.

Related XML Attributes
Parameters
resId String resource ID

public void setSubheadline (CharSequence subheadline)

Sets the subheadline of the object cell.

Subheadline should express extended information about the current content.

Related XML Attributes
Parameters
subheadline The subheadline.

public void setSubheadlineColor (int color)

Sets the text color for subheadline.

public void setSubheadlineFont (Typeface font)

Sets the text font for subheadline.

public void setSubheadlineFont (int fontId)

Sets the text font for subheadline.

public void setSubheadlineLines (int subheadlineLines)

Sets the number of lines of subheadline text view

Related XML Attributes
Parameters
subheadlineLines line number, must be 0, 1, 2 or 3 and less than getLines(). Dynamic layout can be achieved by setting it to 0 with performance trade-off. Subclass may choose to customize it.

public void setSubheadlineSize (float size)

Sets the text size for subheadline.

public void setSubheadlineTextAppearance (int resId)

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

public void setUseBorder (boolean useBorder)

public void setUseCutOut (boolean useCutOut)

public void setUseIcon (boolean useIcon)

public void showDetailImageView ()

Show the detail image view (and the detail image text view). Use case includes: after the detail progress bar reaches its max.

public ProgressBar showDetailProgressBar ()

Configure the detail progress bar view and add it to the view group. Creates it if necessary.

Returns
  • ProgressBar the detail progress bar

public void updateUiOnRead ()

Update UI depending on the isRead status of the AbstractEntityCell If the cell is read, the headline text appearance should be using SubheadlineTextAppearance.

public void updateUiOnSelected ()

Update UI depending on the isSelected status of the AbstractEntityCell. If the cell is selected, the background of the cell will be set to use sap_fiori_color_s5. If the cell is unselected, the UI should be reset back to its original state.

Protected Methods

protected void addSystemView (View v)

Adds internal child views. Always sets layout param's layout_group to LAYOUT_GROUP_INTERNAL

Parameters
v view to be added

protected void addViewToGroup (View v, int group)

Adds the view into specified group.

Parameters
v view
group group

protected static int adjustMeasureSpec (int childSpec, int constraint)

Converts child measurement into EXACTLY if possible.

protected int calculateDynamicHeight (int lines)

protected boolean checkLayoutParams (ViewGroup.LayoutParams p)

protected void checkTextWidth (int textWidth, int descriptionWidth)

Updates StaticLayoutTextViews if width is changed. Important! Don't call requestLayout() here since it's called from onMeasure. Otherwise it would cause repeated onMeasure calls and even Espresso wouldn't be able to locate the root view because of constant layout requests.

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 configureHeadlineLayout ()

Configures headline layout

protected void configureSubheadlineLayout ()

Configures sub headline layout

protected TextPaint createTextPaint (int resId)

Creates TextPaint from the given resource id

protected void doSetDescription (CharSequence description)

Sets description. Subclass can call this directly to work around the restriction imposed by AbstractEntityCell.

protected void ensureAvatarGrid ()

protected void ensureDetailImageView ()

protected void ensureDetailProgressBar ()

protected AbstractEntityCell.GroupLayoutParams generateDefaultLayoutParams ()

protected int getDefaultLines ()

Returns the default lines supported by this cell.

protected int getDescriptionWidth ()

Returns the width for description.

protected int getHeadlineLayoutLines ()

Returns the real lines used by headline.

protected int getHeadlineMaxLines ()

Returns the maximum lines of headline

protected int getHorizontalMargins (View v)

Gets horizontal margin from layout params

protected int getLayoutLines ()

Returns fixed lines or if setLines(0) was used, returns number of lines based on content.

protected int getMaxLines ()

Returns the max number of lines supported by this cell.

protected int getRemainedDescriptionWidth (int parentWidthSpec, int endWidthUsed)

Calculates how much width is left for headline if description is present

protected int getRemainedWidth (int parentWidthSpec, int widthUsed)

Calculates how much width is left

protected TextDirectionHeuristic getTextDirectionHeuristic ()

Returns the current TextDirectionHeuristic.

Returns

protected Layout.Alignment getTextLayoutAlignment ()

Determines how the text should be laid out.

protected int getTitleWidth ()

Returns the width for title area, including headline and subheadline.

protected int getVerticalMargins (View v)

Gets vertical margin from layout params

protected boolean isChild (View child)

Tests whether the given view is a child view

protected boolean loadingDescription ()

protected static void measureChildConstrained (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 measureChildFixed (View child, int width, int height)

Measures child view with fixed width and height

protected void measureChildFixed (View child, int width, int height, boolean touchable)

Measures child view with fixed width and height. If touchable is true, add padding if necessary.

protected void measureTextLayout (StaticLayoutTextView child, int width)

Measures the text view with the given width

protected StaticLayout obtainStaticLayout (CharSequence text, TextPaint paint, int width, int lines, float lineHeight)

Creates a new StaticLayout based on the parameters

Parameters
text text to render
paint how to render
width width of the layout
lines max lines of the layout
lineHeight the height between base lines
Returns
  • the created StaticLayout

protected int retrieveLines ()

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

protected StaticLayoutTextView setTextView (StaticLayoutTextView textView, StaticLayout layout)

Sets the StaticLayout to the view and returns the text view.

Parameters
textView the text view
layout the new layout
Returns
  • the original text view

protected boolean shouldLayout (View view)

Returns whether the given view should be laid out, which means it's a child and is visible.

protected boolean shouldLayout (List<? extends View> views)

Returns true is any item in the given list should be laid out

Parameters
views list of views