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
AbstractEntityCell_headlineLines setHeadlineLines(int)  
AbstractEntityCell_lines setLines(int)  
CollectionViewItem_attribute setAttribute(CharSequence)  
CollectionViewItem_attributeTextAppearance setAttributeTextAppearance(int)  
CollectionViewItem_headline  
CollectionViewItem_headlineTextAppearance  
CollectionViewItem_subheadline  
CollectionViewItem_subheadlineTextAppearance  
[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
[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 be laid out.
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[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

AbstractEntityCell_headlineLines

Related Methods

AbstractEntityCell_lines

Related Methods

CollectionViewItem_attribute

Related Methods

CollectionViewItem_attributeTextAppearance

CollectionViewItem_headline

Related Methods

CollectionViewItem_headlineTextAppearance

Related Methods

CollectionViewItem_subheadline

Related Methods

CollectionViewItem_subheadlineTextAppearance

Related Methods

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

Related XML Attributes
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 be laid out.

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

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)