public class

CollectionViewItem

extends AbstractEntityCell
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ com.sap.cloud.mobile.fiori.object.AbstractEntityCell
         ↳ com.sap.cloud.mobile.fiori.object.CollectionViewItem

Class Overview

The CollectionViewItem Cell fits inside CollectionView, ListView or RecyclerView. It is an alternative view for ObjectCell and/or ContactCell. It emphasizes on image. User can view bigger images than ObjectCell/ContactCell to help them identify each object/contact. If image is not a good identifier or if lots of items do not have image in the dataset, use ObjectCell or ContactCell instead.

* Structure *

Summary

XML Attributes
Attribute Name Related Method Description
com.sap.cloud.mobile.fiori:attribute setAttribute(CharSequence)  
com.sap.cloud.mobile.fiori:attributeTextAppearance setAttributeTextAppearance(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 setHeadlineLines(int) 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:lines setLines(int) Total number of lines. 
com.sap.cloud.mobile.fiori:subheadline The sub headline 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 mSubTitleWidth
[Expand]
Inherited Fields
From class com.sap.cloud.mobile.fiori.object.AbstractEntityCell
From class android.view.View
Public Constructors
CollectionViewItem(Context context)
CollectionViewItem(Context context, AttributeSet attrs)
CollectionViewItem(Context context, AttributeSet attrs, int defStyleAttr)
CollectionViewItem(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
CharSequence getAttribute()
View getAttributeView()
void setAttribute(int resId)
Sets the attribute of the CollectionView item cell.
void setAttribute(CharSequence attribute)
Sets the attribute of the object cell.
void setAttributeTextAppearance(int resId)
Sets the text color, size, style, hint color, and highlight color for attribute from the specified TextAppearance resource.
void setDetailCharacterBackground(Drawable drawable)
Set the background resource of the detail character of the contact cell
void setDetailCharacterBackgroundResource(int res)
Set the background resource of the detail character of the contact cell
void setDetailCharacterBackgroundTintList(int color)
Set the background resource of the detail character image
void setDetailCharacterBackgroundTintList(ColorStateList colorStateList)
Set the tint for the background resource of the detail character of contact cell
void setDetailImageCharacter(CharSequence character)
Set the character sequence to be displayed as placeholder text for contact cell detail image.
void setHeadlineLines(int headlineLines)
Sets the number of lines of headline text view
void setLines(int lines)
Sets the total number of lines
Protected Methods
void checkAttributeWidth(int textWidth)
void checkSubTitleWidth(int textWidth)
void checkTitleWidth(int textWidth)
void configureDescriptionLayout()
Configures StaticLayoutTextView for description field.
void configureHeadlineLayout()
Configures headline layout
void configureSubheadlineLayout()
Configures sub headline layout
int getMaxLines()
Returns the max number of lines supported by this cell.
Layout.Alignment getTextLayoutAlignment()
Determines how the text should laid out.
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
void updateImageOutlineShape()
[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:attribute

Related Methods

com.sap.cloud.mobile.fiori:attributeTextAppearance

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".

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

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

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

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

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

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).

May be a fractional value, which is a floating point number appended with either % or %p, such as "14.5%". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container.

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:lines

Total number of lines.

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

Related Methods

com.sap.cloud.mobile.fiori:subheadline

The sub headline 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 mSubTitleWidth

Public Constructors

public CollectionViewItem (Context context)

public CollectionViewItem (Context context, AttributeSet attrs)

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

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

Public Methods

public CharSequence getAttribute ()

public View getAttributeView ()

public void setAttribute (int resId)

Sets the attribute of the CollectionView item cell.

Attribute is typically a short string of text.

Related XML Attributes
Parameters
resId String resource ID

public void setAttribute (CharSequence attribute)

Sets the attribute of the object cell.

Attribute is typically a short string of text.

Related XML Attributes
Parameters
attribute The attribute.

public void setAttributeTextAppearance (int resId)

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

public void setDetailCharacterBackground (Drawable drawable)

Set the background resource of the detail character of the contact cell

public void setDetailCharacterBackgroundResource (int res)

Set the background resource of the detail character of the contact cell

public void setDetailCharacterBackgroundTintList (int color)

Set the background resource of the detail character image

public void setDetailCharacterBackgroundTintList (ColorStateList colorStateList)

Set the tint for the background resource of the detail character of contact cell

public void setDetailImageCharacter (CharSequence character)

Set the character sequence to be displayed as placeholder text for contact cell detail image.

Typically this is one character wide char sequence

Parameters
character character to display. One character is recommended.

public void setHeadlineLines (int headlineLines)

Sets the number of lines of headline text view

Parameters
headlineLines line number, must be 1

public void setLines (int lines)

Sets the total number of lines

Related XML Attributes
Parameters
lines cell lines, should always be 1

Protected Methods

protected void checkAttributeWidth (int textWidth)

protected void checkSubTitleWidth (int textWidth)

protected void checkTitleWidth (int textWidth)

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 int getMaxLines ()

Returns the max number of lines supported by this cell.

protected Layout.Alignment getTextLayoutAlignment ()

Determines how the text should laid out.

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

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)

protected void updateImageOutlineShape ()