public class

KeyValueCell

extends ViewGroup
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ com.sap.cloud.mobile.fiori.misc.KeyValueCell

Class Overview

The Key(Label)/Value Cell is a Table View Cell which fits inside the Table View container, but also likely to be used in the Multi-column variation of the Collection View. It is ideal for displaying sets of data that also need to display their labels. Key/Value cells are typically found in the Object and Object Details floorplans.

Summary

XML Attributes
Attribute Name Related Method Description
com.sap.cloud.mobile.fiori:expandable setExpandable(boolean) Whether to allow expand when text is too long

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

com.sap.cloud.mobile.fiori:keyText setKey(CharSequence) The key/label of the cell. 
com.sap.cloud.mobile.fiori:keyTextAppearance setKeyTextAppearance(int) Text color, typeface, size, and style for key label. 
com.sap.cloud.mobile.fiori:valueLines setLines(int) Total number of lines for value. 
com.sap.cloud.mobile.fiori:valueText setValue(CharSequence) The value of the cell. 
com.sap.cloud.mobile.fiori:valueTextAppearance setValueTextAppearance(int) Text color, typeface, size, and style for value. 
Constants
int MAX_LINES
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
Fields
protected int mMinTouchSize
protected int mTinyMargin
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
KeyValueCell(Context context)
KeyValueCell(Context context, AttributeSet attrs)
KeyValueCell(Context context, AttributeSet attrs, int defStyleAttr)
KeyValueCell(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
CharSequence getKey()
The key or label text
int getLines()
Returns the number of lines for the value text.
CharSequence getValue()
Returns the value text
boolean isExpandable()
Returns whether the cell can be expanded on demand
void setExpandable(boolean expandable)
Enables/Disables the expand feature.
void setKey(CharSequence key)
Sets the key or label text
void setKeyTextAppearance(int keyTextAppearance)
Sets the text appearance to the key text view.
void setLines(int lines)
Sets the number of lines for the value text.
void setValue(CharSequence value)
Sets the value text
void setValueOnClickListener(View.OnClickListener l)
Registers a callback to be invoked when this view is clicked.
void setValueTextAppearance(int valueTextAppearance)
Sets the text appearance to the value text view.
Protected Methods
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[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

XML Attributes

com.sap.cloud.mobile.fiori:expandable

Whether to allow expand when text is too long

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

Related Methods

com.sap.cloud.mobile.fiori:keyText

The key/label of the cell. Always one line.

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

Text color, typeface, size, and style for key label. Defaults to sap_ui_content_label_color color. Default style: TextAppearance_Fiori_KeyValueCell_Key

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

Total number of lines for value.

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

Related Methods

com.sap.cloud.mobile.fiori:valueText

The value of the cell.

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

Text color, typeface, size, and style for value. Defaults to sap_ui_base_text color. Default style: TextAppearance_Fiori_KeyValueCell_Value

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

Constants

public static final int MAX_LINES

Constant Value: 6 (0x00000006)

Fields

protected int mMinTouchSize

protected int mTinyMargin

Public Constructors

public KeyValueCell (Context context)

public KeyValueCell (Context context, AttributeSet attrs)

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

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

Public Methods

public CharSequence getKey ()

The key or label text

Related XML Attributes

public int getLines ()

Returns the number of lines for the value text.

Related XML Attributes

public CharSequence getValue ()

Returns the value text

Related XML Attributes

public boolean isExpandable ()

Returns whether the cell can be expanded on demand

Related XML Attributes

public void setExpandable (boolean expandable)

Enables/Disables the expand feature. Default value is true.

Related XML Attributes

public void setKey (CharSequence key)

Sets the key or label text

Related XML Attributes

public void setKeyTextAppearance (int keyTextAppearance)

Sets the text appearance to the key text view.

Parameters
keyTextAppearance text appearance resource id

public void setLines (int lines)

Sets the number of lines for the value text. 1 to 6 lines of text is supported. Specify 0 for dynamic layout up to 6 lines.

Related XML Attributes

public void setValue (CharSequence value)

Sets the value text

Related XML Attributes

public void setValueOnClickListener (View.OnClickListener l)

Registers a callback to be invoked when this view is clicked. If this view is not clickable, it becomes clickable. This API should only be called when the value text is actionable, e.g. phone or email, otherwise, use setOnClickListener(OnClickListener)

Parameters
l The callback that will run

public void setValueTextAppearance (int valueTextAppearance)

Sets the text appearance to the value text view.

Parameters
valueTextAppearance text appearance resource id

Protected Methods

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

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)