I have a example & picture attached below.
What i would like to do is change the row height of the second row and leave the headers as they are.
This scrollview is displaying a week of data, Date in header & job description in second row.
I would like to make the second row height 3 time the header height.
Is this possable?
Also is it possable to formate the headers for date formats?
ex. Aug-12 (short month-short-year) First header column.
ex. Mon-25 (short day name-day)
The original Table class admits the same height for the header and the rows.
In the attached project I modified the Table class with two differnt heights.
You can change the values in the class code. HeaderHeight = 30dip
RowHeight = 60dip
Also is it possable to formate the headers for date formats?
ex. Aug (short month) First Header Column Only.
ex. Mon-25 (short day name-day) The remaining 7 Columns
Yes.
In the attached project I added following routines in the Table class:
- GetHeaderValues
- SetHeaderValues
- changed NumberOfColumns from Private to Public
The date format change is done in the Main activity.
In my first test I modified the date in the Table class but then it would have been specific to your application.
So I added the routines mentioned above to get and set the header values from outsides.
Yes, you can modify the ShowRow routine in the Table class like below.
B4X:
Private Sub ShowRow(row As Int)
If visibleRows.ContainsKey(row) Then Return
'Log("ShowRow: " & row)
Dim lbls() As Label
Dim values() As String
lbls = GetLabels(row)
values = Data.Get(row)
visibleRows.Put(row, lbls)
Dim rowColor() As Object
' If row = SelectedRow Then
' rowColor = SelectedDrawable
' Else If row Mod 2 = 0 Then
If row Mod 2 = 0 Then
rowColor = Drawable1
Else
rowColor = Drawable2
End If
For I = 0 To lbls.Length - 1
SV.Panel.AddView(lbls(I), Header.GetView(I).Left, row * RowHeight, Header.GetView(I).Width, _
RowHeight - 1dip)
lbls(I).Text = values(I)
lbls(I).Background = rowColor(I)
Next
End Sub
Your code won't work because DisplyWeek.GetHeaderValues returns a string array with the header values with the new format.
I suggest you to add a global string array with the dates for each column and fill it in the ChangeHeaders routine with the desired format.
Then the Sub DisplyWeek_HeaderClick routine is quite simple:
B4X:
Sub DisplyWeek_HeaderClick(col As Int)
etxtDate.Text = Dates(col)
End Sub