public class

DataTableRow

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

Summary

XML Attributes
Attribute Name Related Method Description
GridTableRow_textLines setLines(int)  
Constants
int ALIGN_END
int ALIGN_START
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
Fields
protected int m1lineHeight
protected int m1lineImageHeight
protected int m2linesHeight
protected int[] mAlignments
protected int mColumnDefaultWidth
protected int mColumnMaxWidth
protected int mColumnPaddingH
protected List<View> mColumns
protected int mDefaultHeaderLineHeight
protected int mDefaultHeaderTextSize
protected int mDefaultLineHeight
protected int mDefaultTextSize
protected boolean mDetectDynamicWidth
protected int mDynamicColumnMinWidth
protected int mDynamicIndex
protected int mEdgePaddingH
protected int mHeaderHeight
protected boolean mIsHeader
protected int mLines
protected int mMinHeight
protected int[] mPixelColumnWidths
protected float[] mRawColumnWidths
protected boolean mRowHasImage
protected View mSeparator
protected int mSeparatorWidth
protected int mStickyMaxWidth
protected boolean mStickyMode
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
DataTableRow(Context context)
Public Methods
View getColumn(int columnIndex)
int getFirstColumnWidth()
ImageView getImageView(int index)
int getRowWidth()
void setColumnWidths(float... rawColumnWidths)
Sets the widths of the columns from start to end.
void setDetectDynamicWidth(boolean detect)
Toggles whether the row will be laid out as if no dynamic column is specified when there is no space for the specified dynamic column to be displayed.
void setDynamicColumn(int index)
Designates a column to have dynamic width on tablets.
void setHeader(boolean header)
void setImage(int index, Drawable image)
Sets the image for the column with the given index.
void setImageDescription(int index, CharSequence desc)
void setImageDescription(int index, int resId)
void setLines(int lines)
Sets number of lines for TextView column.
void setMaxColumnWidth(int maxWidth)
Sets the maximum width of non-sticky columns.
void setMaxStickyColumnWidth(int maxWidth)
Sets the maximum width of the sticky column.
void setMinDynamicColumnWidth(int minWidth)
Sets the minimum width of the dynamic column.
void setText(int index, CharSequence text)
Sets the text for the column with the given index.
void setTextAlignment(int... alignments)
Sets the text alignment of the columns in the row.
void triggerRipple(MotionEvent event)
Protected Methods
boolean calculateDynamicWidth()
int calculateMaxColumnWidth(int maxWidth, boolean isSticky)
void calculateNonDynamicWidth()
void configureText(View child)
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
void setStickyMode(boolean mode)
[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

GridTableRow_textLines

Related Methods

Constants

public static final int ALIGN_END

Constant Value: 1 (0x00000001)

public static final int ALIGN_START

Constant Value: 0 (0x00000000)

Fields

protected int m1lineHeight

protected int m1lineImageHeight

protected int m2linesHeight

protected int[] mAlignments

protected int mColumnDefaultWidth

protected int mColumnMaxWidth

protected int mColumnPaddingH

protected List<View> mColumns

protected int mDefaultHeaderLineHeight

protected int mDefaultHeaderTextSize

protected int mDefaultLineHeight

protected int mDefaultTextSize

protected boolean mDetectDynamicWidth

protected int mDynamicColumnMinWidth

protected int mDynamicIndex

protected int mEdgePaddingH

protected int mHeaderHeight

protected boolean mIsHeader

protected int mLines

protected int mMinHeight

protected int[] mPixelColumnWidths

protected float[] mRawColumnWidths

protected boolean mRowHasImage

protected View mSeparator

protected int mSeparatorWidth

protected int mStickyMaxWidth

protected boolean mStickyMode

Public Constructors

public DataTableRow (Context context)

Public Methods

public View getColumn (int columnIndex)

public int getFirstColumnWidth ()

public ImageView getImageView (int index)

public int getRowWidth ()

public void setColumnWidths (float... rawColumnWidths)

Sets the widths of the columns from start to end. The sticky column has a max width of a third of the screen width.

Parameters
rawColumnWidths [1-max]F for fixed length (dp). Unlike GridTableRow, percentage width is not supported. Dynamic width is only supported for tablet.

public void setDetectDynamicWidth (boolean detect)

Toggles whether the row will be laid out as if no dynamic column is specified when there is no space for the specified dynamic column to be displayed. This is enabled by default.

Parameters
detect Whether available space should be checked to determine the usage of dynamic column.

public void setDynamicColumn (int index)

Designates a column to have dynamic width on tablets. Row width will be equal to screen width. By default, no column has dynamic width.

Parameters
index The index of the column that will have dynamic width. Setting to a negative value will disable the dynamic column.

public void setHeader (boolean header)

public void setImage (int index, Drawable image)

Sets the image for the column with the given index. If both text and image are set, the image will take priority.

Parameters
index The column the image will be set to.
image The image to be set.

public void setImageDescription (int index, CharSequence desc)

public void setImageDescription (int index, int resId)

public void setLines (int lines)

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

Related XML Attributes

public void setMaxColumnWidth (int maxWidth)

Sets the maximum width of non-sticky columns. By default, this value is half of the screen width.

Parameters
maxWidth The width that columns will be clamped to if they exceed it.

public void setMaxStickyColumnWidth (int maxWidth)

Sets the maximum width of the sticky column. By default, this value is a third of the screen width.

Parameters
maxWidth The width that the sticky column will be clamped to if it exceeds it.

public void setMinDynamicColumnWidth (int minWidth)

Sets the minimum width of the dynamic column. This is used if setDetectDynamicWidth(true) to calculate whether the dynamic column has enough space to be displayed.

Parameters
minWidth The minimum width of the dynamic column to trigger dynamic layout if setDetectDynamicWidth(true).

public void setText (int index, CharSequence text)

Sets the text for the column with the given index. Text that is purely numeric will be aligned with the end of the column, while other formats will be aligned with the start of the column.

Parameters
index The column the text will be set to.
text The text to be set.

public void setTextAlignment (int... alignments)

Sets the text alignment of the columns in the row.

Parameters
alignments An array of alignments (ALIGN_START, ALIGN_END).

public void triggerRipple (MotionEvent event)

Protected Methods

protected boolean calculateDynamicWidth ()

protected int calculateMaxColumnWidth (int maxWidth, boolean isSticky)

protected void calculateNonDynamicWidth ()

protected void configureText (View child)

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

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)

protected void setStickyMode (boolean mode)