public class

GridTableRow

extends ConstraintLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.support.constraint.ConstraintLayout
         ↳ com.sap.cloud.mobile.fiori.object.GridTableRow

Class Overview

A data table is a range of labeled columns and rows used to present numbers, text, or even images. Generally, data tables are a grid layout of columns and rows. Data tables are available only on regular screen sizes. On compact screen sizes, use ObjectCell instead. Data tables are used to show summary of an object, therefore only small image and short text should be used. The maximum text lines is 2 and the maximum image size is 40dp*40dp.

Summary

Nested Classes
class GridTableRow.LayoutParams GridTableRow LayoutParams extends ConstraintLayout.LayoutParams to add columnIndex and columnWidth so that child view can specify their order in column list and expected column width. 
XML Attributes
Attribute Name Related Method Description
com.sap.cloud.mobile.fiori:isHeader setHeader(boolean) Whether this row is a table header

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

com.sap.cloud.mobile.fiori:isPercentageOutOfRemainingWidth setPercentageOutOfRemainingWidth(boolean) Whether the percentage number passed in setColumnWidths(float) is calculated out of remaining width, which is the total table width minus all the fixed column widths. 
com.sap.cloud.mobile.fiori:layout_column setColumns(View) Column index that starts from 0. 
com.sap.cloud.mobile.fiori:layout_columnWidth setColumnWidths(float) The column width. 
com.sap.cloud.mobile.fiori:textLines setLines(int) Total number of lines. 
com.sap.cloud.mobile.fiori:useDefaultTextSize setUseDefaultTextSize(boolean) Whether default font size should be used for all the TextView columns

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

[Expand]
Inherited Constants
From class android.support.constraint.ConstraintLayout
From class android.view.ViewGroup
From class android.view.View
Fields
protected List<View> mColumns
protected boolean mInColumnLayout
protected boolean mNeedsColumnLayout
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
GridTableRow(Context context)
GridTableRow(Context context, AttributeSet attrs)
GridTableRow(Context context, AttributeSet attrs, int defStyleAttr)
Public Methods
void addView(View child, int index, ViewGroup.LayoutParams params)
GridTableRow.LayoutParams generateLayoutParams(AttributeSet attrs)
View getColumn(int columnIndex)
float[] getColumnWidths()
Returns the column width.
int getLines()
Returns how many lines of text are allowed for TextView column member
boolean isHeader()
Returns whether this row is used as table header
boolean isPercentageOutOfRemainingWidth()
Returns whether the percentage number passed in setColumnWidths(float) is calculated out of remaining width, which is the total table width minus all the fixed column widths.
boolean isUseDefaultTextSize()
Returns whether default text size will be applied to all the TextView columns.
void requestLayout()
void setColumnWidths(float... rawColumnWidths)
Column width are laid out from start to end, until when dynamic width is specified, in which case the layout will change from end to start.
void setColumns(View... columns)
Sets all the columns.
void setHeader(boolean header)
Sets whether this row is used as table header
void setLines(int lines)
Sets number of lines for TextView column.
void setPercentageOutOfRemainingWidth(boolean percentageOutOfRemainingWidth)
Sets whether the percentage number passed in setColumnWidths(float) is calculated out of remaining width, which is the total table width minus all the fixed column widths.
void setUseDefaultTextSize(boolean useDefaultTextSize)
Sets whether to use the default text size and line height.
Protected Methods
boolean checkLayoutParams(ViewGroup.LayoutParams p)
GridTableRow.LayoutParams generateDefaultLayoutParams()
ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p)
void layoutColumns(int widthMeasureSpec)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[Expand]
Inherited Methods
From class android.support.constraint.ConstraintLayout
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:isHeader

Whether this row is a table header

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

Related Methods

com.sap.cloud.mobile.fiori:isPercentageOutOfRemainingWidth

Whether the percentage number passed in setColumnWidths(float) is calculated out of remaining width, which is the total table width minus all the fixed column widths.

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

com.sap.cloud.mobile.fiori:layout_column

Column index that starts from 0.

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

Related Methods

com.sap.cloud.mobile.fiori:layout_columnWidth

The column width. (0-1) for percentage; [1-max] for fixed width (dp); -1 for dynamic width (only 1 dynamic column is allowed inside a row)

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

Related Methods

com.sap.cloud.mobile.fiori:textLines

Total number of lines.

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

Related Methods

com.sap.cloud.mobile.fiori:useDefaultTextSize

Whether default font size should be used for all the TextView columns

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

Fields

protected List<View> mColumns

protected boolean mInColumnLayout

protected boolean mNeedsColumnLayout

Public Constructors

public GridTableRow (Context context)

public GridTableRow (Context context, AttributeSet attrs)

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

Public Methods

public void addView (View child, int index, ViewGroup.LayoutParams params)

public GridTableRow.LayoutParams generateLayoutParams (AttributeSet attrs)

public View getColumn (int columnIndex)

public float[] getColumnWidths ()

Returns the column width. (0-1)F for percentage; [1-max]F for fixed width (dp); -1F for dynamic width (only 1 dynamic column is allowed)

public int getLines ()

Returns how many lines of text are allowed for TextView column member

Related XML Attributes

public boolean isHeader ()

Returns whether this row is used as table header

Related XML Attributes

public boolean isPercentageOutOfRemainingWidth ()

Returns whether the percentage number passed in setColumnWidths(float) is calculated out of remaining width, which is the total table width minus all the fixed column widths.

public boolean isUseDefaultTextSize ()

Returns whether default text size will be applied to all the TextView columns.

public void requestLayout ()

public void setColumnWidths (float... rawColumnWidths)

Column width are laid out from start to end, until when dynamic width is specified, in which case the layout will change from end to start.

Parameters
rawColumnWidths (0-1)F for percentage; [1-max]F for fixed length (dp); -1F for dynamic width (only 1 dynamic column is allowed). Note: 100% can be specified as -1F.

public void setColumns (View... columns)

Sets all the columns. Column index will be determined by the order they are passed in. Note: This operation is costly. If you're just updating text or image of an existing column, no need to call this method.

Parameters
columns child views. If not id is given, a new id will be generated.

public void setHeader (boolean header)

Sets whether this row is used as table header

Related XML Attributes

public void setLines (int lines)

Sets number of lines for TextView column. Recommends at most 2 lines.

Related XML Attributes

public void setPercentageOutOfRemainingWidth (boolean percentageOutOfRemainingWidth)

Sets whether the percentage number passed in setColumnWidths(float) is calculated out of remaining width, which is the total table width minus all the fixed column widths. if not set, percentage is calculated by the whole table width by default.

Parameters
percentageOutOfRemainingWidth default is false

public void setUseDefaultTextSize (boolean useDefaultTextSize)

Sets whether to use the default text size and line height. Default is true. Sets it to false to use customized text size.

Protected Methods

protected boolean checkLayoutParams (ViewGroup.LayoutParams p)

protected GridTableRow.LayoutParams generateDefaultLayoutParams ()

protected ViewGroup.LayoutParams generateLayoutParams (ViewGroup.LayoutParams p)

protected void layoutColumns (int widthMeasureSpec)

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)