Private Sub ListByRecord()
lstRowBrowser.Clear
Dim DataRow As Map = BrowsedTable.GetRow(RowIndex)
Dim drs As Int = DataRow.Size
Dim ts As Int = BrowsedTable.Size
Activity.Title = "Row Details: " & (RowIndex) & " of " & ts
Dim TlabelHeight As Int = 35 'title label height
Dim DlabelHeight As Int = 40 'description label height
Dim LabelsSpaceOffset As Int = 4 'space
Dim TlabelFirstTop As Int = 2 'title label first top position
Dim DLabelFirstTop As Int = TlabelFirstTop + TlabelHeight + 1 'description label first top position
Dim ButtonHeight As Int = 48
Dim ButtonWidth As Int = 48
'Dim ButtonSpaceOffset As Int = 20
Dim ButtonFirstTop As Int = 14
Dim p As Panel
p.Initialize("")
Activity.AddView(p, 0, 0, 100%x, drs * (TlabelHeight + DlabelHeight + 2)) 'height for total number of labels heights
'p.LoadLayout("CLVrow")
p.RemoveView
p.Color = Colors.White
For Col = 0 To drs -1
Dim plblRowTitle As Label = CreateLable("lblRowTitle",Colors.White,0xFF7A7A7A,14)
Dim plblDescription As Label = CreateLable("lblDescription", Colors.White,0xFF000000,15)
Dim bButton As Button = CreateButton
Dim myCol As B4XTableColumn = BrowsedTable.Columns.Get(Col)
Dim colname As String = myCol.Title
Dim Value As Object = DataRow.GetValueAt(Col)
If Value = Null Then Value = ""
linkifyTextView(plblDescription,15)
plblRowTitle.Text = colname
plblDescription.Text = Value
Dim tTop As Int
Dim dTop As Int
Dim bTop As Int
If Col = 0 Then
tTop = TlabelFirstTop
dTop = DLabelFirstTop
bTop = ButtonFirstTop
Else
tTop = Col * (TlabelHeight + DlabelHeight) + LabelsSpaceOffset + TlabelFirstTop
dTop = Col * (TlabelHeight + DlabelHeight) + LabelsSpaceOffset + DLabelFirstTop
bTop = tTop + (TlabelHeight / 2)'Col * (ButtonHeight) + ButtonSpaceOffset + ButtonFirstTop
End If
p.AddView(plblRowTitle,4,tTop,90%y,TlabelHeight)
p.AddView(plblDescription,4,dTop,90%y,DlabelHeight)
p.AddView(bButton,50%y + 10,bTop,ButtonWidth,ButtonHeight)
Log (bTop)
Next
lstRowBrowser.Add(p,"")
End Sub