Is the module (.bas) attached the source of the library? It is commented with "version: 1.20"V1.50 has been released. See first post for more information.
I had supposed that, seeing this:It was the correct module with the wrong version comment. I've fixed it.
'Added the following sub as per Corwin and Erel's suggestion to support FAB
' hiding and showing while CustomListView is scrolled
Sub sv_ScrollChanged(Position As Int)
CallSub2(CallBack, EventName & "_ScrollChanged", Position)
End Sub
Public Sub Initialize (vCallback As Object, vEventName As String)
EventName = vEventName
CallBack = vCallback
sv.Initialize2(0, "sv")
items.Initialize
panels.Initialize
'these defaults will be used when the view is added by code
dividerHeight = 2dip
'The next line of code is commented by as per the user prosg in the following thread
'https://www.b4x.com/android/forum/threads/customlistview-background-color.53363/#post-334402
'sv.Color = 0xFFD9D7DE
sv.Color = Colors.White 'This was added by Anser
DefaultTextColor = Colors.White
DefaultTextSize = 16
DefaultTextBackgroundColor = Colors.Black
DefaultTextBackground = Null
PressedDrawable.Initialize(0xFF7EB4FA, 2dip)
End Sub
'The next 4 lines of code is added by Anser as per the user prosg in the following thread
'https://www.b4x.com/android/forum/threads/customlistview-background-color.53363/#post-334402
'This will resolve the gray backcolor issue when there are not enough contents in CustomListView to fill the entire screen length
Dim lblDivider As Label
lblDivider.Initialize("")
lblDivider.Color = Colors.RGB(217,215,222)
p.AddView(lblDivider, 0,p.Height-1dip, 100%x, 1dip)
'Adds a custom item at the specified index.
Public Sub InsertAt(Index As Int, Pnl As Panel, ItemHeight As Int, Value As Object)
Dim sd As StateListDrawable
sd.Initialize
sd.AddState(sd.State_Pressed, PressedDrawable)
sd.AddCatchAllState(Pnl.Background)
'create another panel to handle the click event
Dim p As Panel
p.Initialize("panel")
p.Background = sd
Dim cd As ColorDrawable
cd.Initialize(Colors.Transparent, 0)
Pnl.Background = cd
p.AddView(Pnl, 0, 0, sv.Width, ItemHeight)
p.Tag = Index
If Index = items.Size Then
items.Add(Value)
panels.Add(p)
Dim top As Int
If Index = 0 Then top = dividerHeight Else top = sv.Panel.Height
sv.Panel.AddView(p, 0, top, sv.Width, ItemHeight)
Else
Dim top As Int
If Index = 0 Then
top = dividerHeight
Else
Dim previousPanel As Panel
previousPanel = panels.Get(Index - 1)
top = previousPanel.top + previousPanel.Height + dividerHeight
End If
Dim p2 As Panel
For i = Index To panels.Size - 1
p2 = panels.Get(i)
p2.top = p2.top + ItemHeight + dividerHeight
p2.Tag = i + 1
Next
items.InsertAt(Index, Value)
panels.InsertAt(Index, p)
sv.Panel.AddView(p, 0, top, sv.Width, ItemHeight)
End If
'The next 4 lines of code is added by Anser as per the user prosg in the following thread
'https://www.b4x.com/android/forum/threads/customlistview-background-color.53363/#post-334402
'This will resolve the gray backcolor issue when there are not enough contents in CustomListView to fill the entire screen length
Dim lblDivider As Label
lblDivider.Initialize("")
lblDivider.Color = Colors.RGB(217,215,222)
p.AddView(lblDivider, 0,p.Height-1dip, 100%x, 1dip)
sv.Panel.Height = sv.Panel.Height + ItemHeight + dividerHeight
If items.Size = 1 Then sv.Panel.Height = sv.Panel.Height + dividerHeight
End Sub
OK. I didn't notice that the source code was also there, I blindly jumped into the conclusion that from this version onward only the lib will be available.Use the source code instead of the library. There aren't many changes and it shouldn't be difficult to apply the changes you did to the new version. You can use a tool such as WinMerge (http://winmerge.org/?lang=en) to compare the two versions.
1. You should create a NEW Thread in the questions forum for EACH question you haveHi -
https://www.b4x.com/android/forum/threads/class-customlistview.46560/Hi all,
is there a similar view for B4i?
Press on Ctrl + P (clean project) and then run your program. It will cause the compiler to make a full deployment and will run faster in debug mode.
Please start a new thread in the questions forum.Is there any difference when using the customlistview in debugging/release mode?.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?