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
KeyValueCell_expandable setExpandable(boolean)  
KeyValueCell_keyText setKey(CharSequence)  
KeyValueCell_keyTextAppearance setKeyTextAppearance(int)  
KeyValueCell_valueLines setLines(int)  
KeyValueCell_valueText setValue(CharSequence)  
KeyValueCell_valueTextAppearance setValueTextAppearance(int)  
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
void collapse()
void expand()
CharSequence getKey()
The key or label text
int getLines()
Returns the number of lines for the value text.
KeyValueCell.STATE getState()
CharSequence getValue()
Returns the value text
void hideToggleButton()
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)
void onRestoreInstanceState(Parcelable state)
Parcelable onSaveInstanceState()
[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

KeyValueCell_expandable

Related Methods

KeyValueCell_keyText

Related Methods

KeyValueCell_keyTextAppearance

Related Methods

KeyValueCell_valueLines

Related Methods

KeyValueCell_valueText

Related Methods

KeyValueCell_valueTextAppearance

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 void collapse ()

public void expand ()

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 KeyValueCell.STATE getState ()

public CharSequence getValue ()

Returns the value text

Related XML Attributes

public void hideToggleButton ()

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.

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

Related XML Attributes
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)

protected void onRestoreInstanceState (Parcelable state)

protected Parcelable onSaveInstanceState ()