Class

AndroidMobileTable

AndroidMobileTable


Description

An AndroidMobileTable is used for displaying a list of data.

Methods

Name

Parameters

Returns

Shared

AddRow

value As String, detail As String = ""

AddRowAt

row As Integer, value As String, detail As String = ""

ClearFocus

Constructor

Handle

Ptr

Refresh

RemoveAllRows

RemoveRowAt

row As Integer

RowCount

Integer

RowBackgroundColorAt

row As Integer

Color

row As Integer, Assigns value As Color

RowBoldAt

row As Integer

Boolean

row As Integer, Assigns value As Boolean

RowDetailAt

row As Integer

String

row As Integer, Assigns value As String

RowDetailColorAt

row As Integer

Color

row As Integer, Assigns value As Color

RowDetailTagAt

row As Integer

Variant

row As Integer, Assigns value As Variant

RowPictureAt

row As Integer, onRight As Boolean = False

Picture

row As Integer, onRight As Boolean = False, marginSize As Integer, Assigns pic As Picture

row As Integer, onRight As Boolean = False, Assigns pic As Picture

row As Integer, Assigns pic As Picture

RowTagAt

row As Integer

Variant

row As Integer, Assigns value As Variant

RowTextAlignmentAt

row As Integer

Alignments

row As Integer, Assigns alignment As Alignments

RowTextAt

row As Integer

String

row As Integer, Assigns value As String

RowTextColorAt

row As Integer

Color

row As Integer, Assigns value As Color

SetFocus

Events

Name

Parameters

Returns

Closing

Opening

SelectionChanged

Enumerations

AndroidMobileTable.Alignments

Alignments

Used to indicate how text in a row should be aligned.

Enum

Description

Center

The cell value will be center-aligned.

Justified

The text is fully justified.

Left

The cell value will be left-justified.

Natural

The default alignment as specified by Android.

Right

The cell value will be right-justified.

Property descriptions


AndroidMobileTable.AccessibilityHint

AccessibilityHint As String

The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.

Me.AccessibilityHint = "Click to calculate the value and display the next screen."

AndroidMobileTable.AccessibilityLabel

AccessibilityLabel As String

The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.

Me.AccessibilityLabel = "Calculate the value."

AndroidMobileTable.Enabled

Enabled As Boolean

Indicates whether the control is enabled or disabled.

Disable the button:

Button1.Enabled = False

AndroidMobileTable.HasHeader

HasHeader As Boolean

Indicates whether header area of the table appears or not. The default is False.


AndroidMobileTable.Header

Header As String

The caption of the table header.


AndroidMobileTable.HeaderFont

HeaderFont As Font

The name of the font used to draw the header.


AndroidMobileTable.Height

Height As Integer

The height of the control.


AndroidMobileTable.lastaddedrowindex

LastAddedRowIndex As Integer

The row number of the row last added by the AddRow or AddRowAt methods.

This property is read-only.


AndroidMobileTable.LockBottom

LockBottom As Boolean

Determines whether the bottom edge of the control should stay at a set distance from the bottom edge of the parent control, if there is one, or the owning layout.

This property can be set in the control's Inspector. The following example sets it in code.

Me.LockBottom = True

AndroidMobileTable.LockLeft

LockLeft As Boolean

Determines whether the left edge of the control should stay at a set distance from the left edge of the parent control, if there is one, or the owning layout.

LockLeft and Locktop default to True when you add a new control to a layout. Existing controls will be altered only if LockRight and/or LockBottom are not set. LockLeft has no effect unless LockRight is True.

This property can be set in the control's Inspector. The following example sets it in code.

Me.LockLeft = True

AndroidMobileTable.LockRight

LockRight As Boolean

Determines whether the right edge of the control should stay at a set distance from the right edge of the parent control, if there is one, or the owning layout.

This property can be set in the control's Inspector. The following example sets it in code.

Me.LockRight = True

AndroidMobileTable.LockTop

LockTop As Boolean

Determines whether the top edge of the control should stay at a set distance from the top edge of the parent control, if there is one, or the owning layout.

LockTop and LockLeft default to True when you add a control to a layout. Existing controls will be altered only if LockRight and/or LockBottom are not set. LockTop has no effect unless LockBottom is True.

This property can be set in the control's Inspector. The following example sets it in code.

Me.LockTop = True

AndroidMobileTable.Left

Left As Integer

The left position of the control.


AndroidMobileTable.Name

Name As String

The name of the control.


AndroidMobileTable.Parent

Parent As MobileUIControl

The parent (sometimes called a "Super") class of the control.

This property is read-only.


AndroidMobileTable.RowDetailFont

RowDetailFont As Font

The font used to draw the row detail.


AndroidMobileTable.RowTextFont

RowTextFont As Font

The font used to draw the row text.


AndroidMobileTable.ScrollPosition

ScrollPosition As Integer

The row index/number of the first visible row in the table.


AndroidMobileTable.SelectedRowIndex

SelectedRowIndex As Integer

The row index/number of the last row tapped by the user or set via SelectedRowIndex.


AndroidMobileTable.SelectedRowText

SelectedRowText As String

The text of the last row tapped by the user or set via SelectedRowIndex.


AndroidMobileTable.SeparatorColor

SeparatorColor As color

The color of the line that separates rows in the table.


AndroidMobileTable.SeparatorThickness

SeparatorThickness As color

The thickness of the line that separates rows in the table. The default value is 1.

There does not appear to be any upper limit to the thickness.


AndroidMobileTable.Top

Top As Integer

The top position of the control.


AndroidMobileTable.Visible

Visible As Boolean

Indicates whether the control is visible.

Make a button invisible:

Button1.Visible = False

AndroidMobileTable.Width

Width As Integer

The width of the control.

Method descriptions


AndroidMobileTable.AddRow

AddRow(value As String, detail As String = "")

Adds a new row with the value passed.

Adds five rows to a table:

For i As Integer = 0 To 4
  Table1.AddRow("Row " + i.ToString)
Next

AndroidMobileTable.AddRowAt

AddRowAt(row As Integer, value As String, detail As String = "")

Adds a new row with the value at the row index.

Table1.AddRowAt(12, "Hello World!")

Add a row in the first position of the Table:

Table1.AddRowAt(0, "First Row")

AndroidMobileTable.ClearFocus

ClearFocus

Removes the focus from the control.

TextField1.ClearFocus

AndroidMobileTable.Constructor

Constructor

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a table with the specified format.


AndroidMobileTable.Handle

Handle As Ptr

The handle to the underlying native OS control.


AndroidMobileTable.Refresh

Refresh

Marks the control so that it will be redrawn during the next event loop.

Call Refresh to force a Canvas to redraw itself:

Canvas1.Refresh

AndroidMobileTable.RemoveAllRows

RemoveAllRows

Removes all rows from the table.

Remove all rows:

Table1.RemoveAllRows

AndroidMobileTable.RemoveRowAt

RemoveRowAt(row As Integer)

Removes the row at the index passed.

Removes row 4:

Table1.RemoveRowAt(4)

AndroidMobileTable.RowCount

RowCount As Integer

The number of rows in the table.

Get the counts of rows:

Var rowCount As Integer
rowCount = Table1.RowCount

AndroidMobileTable.RowBackgroundColorAt

RowBackgroundColorAt(row As Integer) As Color

The background color of the row specified.


AndroidMobileTable.RowBackgroundColorAt

RowBackgroundColorAt(row As Integer, Assigns value As Color)

Assigns the color as the background color of the row specified.

Sets the background of first row to red:

Table1.RowBackgroundColorAt(0) = Color.Red

AndroidMobileTable.RowBoldAt

RowBoldAt(row As Integer) As Boolean

Indicates if the font style of the row specified is bold or not.


AndroidMobileTable.RowBoldAt

RowBoldAt(row As Integer, Assigns value As Boolean)

Sets the font style of the row specified to bold (True) or plain (false).

Set the font style of the first row to bold:

Table1.RowBoldAt(0) = True

AndroidMobileTable.RowDetailAt

RowDetailAt(row As Integer) As String

The text of the detail section of the row specified.


AndroidMobileTable.RowDetailAt

RowDetailAt(row As Integer, Assigns value As String)

Sets the text in the detail section of the row specified to the value assigned.

Set the detail section of the first row:

Table1.RowDetailAt(0) = "Hey, this is the first row!"

AndroidMobileTable.RowDetailColorAt

RowDetailColorAt(row As Integer) As Color

The color of the detail text of the row specified.


AndroidMobileTable.RowDetailColorAt

RowDetailColorAt(row As Integer, Assigns value As Color)

Assigns the color as the color of the detail text row specified.

Sets the detail text color of first row to red:

Table1.RowDetailColorAt(0) = Color.Red

AndroidMobileTable.RowDetailTagAt

RowDetailTagAt(row As Integer) As Variant

The value of the tag for the detail of the row specified.


AndroidMobileTable.RowDetailTagAt

RowDetailTagAt(row As Integer, Assigns value As Variant)

Assigns a value to the tag of the row specified.

Sets the tag of the detail of the first row to 42:

Table1.RowDetailTagAt(0) = 42

AndroidMobileTable.RowPictureAt

RowPictureAt(row As Integer, onRight As Boolean = False) As Picture

The picture (if any) on the right side of the row specified.


AndroidMobileTable.RowPictureAt

RowPictureAt(row As Integer, onRight As Boolean = False, marginSize As Integer, Assigns pic As Picture)

Assigns the picture to the side of the row and with the margin specified.

Sets the right-side picture of the first row to the picture in named checkmark with a margin of 2:

Table1.RowPictureAt(0, True, 2) = checkmark

AndroidMobileTable.RowPictureAt

RowPictureAt(row As Integer, onRight As Boolean = False, Assigns pic As Picture)

Assigns the picture to the side of the row specified.

Sets the right-side picture of the first row to the picture in named checkmark:

Table1.RowPictureAt(0, True) = checkmark

AndroidMobileTable.RowPictureAt

RowPictureAt(row As Integer, Assigns pic As Picture)

Assigns the picture to the left side of the row specified.

Sets the left-side picture of the first row to the picture in named checkmark:

Table1.RowPictureAt(0) = checkmark

AndroidMobileTable.RowTagAt

RowTagAt(row As Integer) As Variant

The value of the tag of the row specified.


AndroidMobileTable.RowTagAt

RowTagAt(row As Integer, Assigns value As Variant)

Assigns a value to the tag of the row specified.

Sets the tag for the first row to 42:

Table1.RowTagAt(0) = 42

AndroidMobileTable.RowTextAlignmentAt

RowTextAlignmentAt(row As Integer) As Alignments

The alignment of the text of the row specified.


AndroidMobileTable.RowTextAlignmentAt

RowTextAlignmentAt(row As Integer, Assigns alignment As Alignments)

Assigns the alignment of the text of the row specified.

Sets the text alignment of the first row to center:

Table1.RowTextAlignmentAt(0) = AndroidMobileTable.Alignments.Center

AndroidMobileTable.RowTextAt

RowTextAt(row As Integer) As String

The text of the row specified.


AndroidMobileTable.RowTextAt

RowTextAt(row As Integer, Assigns value As String)

Sets the text of the row specified to the value assigned.

Set the text of the first row:

Table1.RowTextAt(0) = "Hey, this is the first row!"

AndroidMobileTable.RowTextColorAt

RowTextColorAt(row As Integer) As Color

The color of the text of the row specified.


AndroidMobileTable.RowTextColorAt

RowTextColorAt(row As Integer, Assigns value As Color)

Assigns the color of the text of the row specified.

Sets the text color of first row to red:

Table1.RowTextColorAt(0) = Color.Red

AndroidMobileTable.SetFocus

SetFocus

Sets the focus to the control.

TextField1.SetFocus

Event descriptions


AndroidMobileTable.Closing

Closing

Called when the control's layout is closing.


AndroidMobileTable.Opening

Opening

Called when the control's layout is opening.

This is where you typically put initialization code.

This example in the Opening event sets the table's separator color to red:

Me.SeparatorColor = Color.Red

AndroidMobileTable.SelectionChanged

SelectionChanged

A row has been selected.

Notes

An AndroidMobileTable has only a single column of cells so by default it can only show one column of data.

Sample code

Add five rows to a table:

' Simple usage
For i As Integer = 0 To 4
  Table1.AddRow("Row " + i.ToString)
Next

Compatibility

Android projects on the Android operating system.

See also

MobileUIControl parent class