Erel quickly and graciously provided me with code to greatly improve (I think) CLVExpandable Here, IT works perfectly in B4A and B4i, however it doesn't work properly in B4J.
It works on the list items at the top of the list, but as you work your way down the list the "Push" gets smaller and smaller
This is the code Erel provided and a sample project is below. to replace the existing code in CLVExpandable.
The problem seems to be that delta gets smaller and smaller as yo go down through the list until, on the last couple of items it is actually negative.
Thanks for any help.
It works on the list items at the top of the list, but as you work your way down the list the "Push" gets smaller and smaller
This is the code Erel provided and a sample project is below. to replace the existing code in CLVExpandable.
B4X:
Public Sub ExpandItem (index As Int)
ResizeItem(index, False)
Dim item As CLVItem = mCLV.GetRawListItem(index)
Dim delta As Int = item.Offset + item.Size - mCLV.sv.ScrollViewOffsetY - mCLV.AsView.Height
If delta > 0 Then
Sleep(5)
Dim offset As Int = mCLV.sv.ScrollViewOffsetY + delta
#if B4i
Dim nsv As ScrollView = mCLV.sv
nsv.ScrollTo(0, offset, True)
#else if B4J
mCLV.sv.ScrollViewOffsetY = offset
#Else If B4A
Dim nsv As ScrollView = mCLV.sv
nsv.ScrollPosition = offset
#End If
End If
End Sub
The problem seems to be that delta gets smaller and smaller as yo go down through the list until, on the last couple of items it is actually negative.
Thanks for any help.