Hi all,
Maybe I'm stupid, it start to feel like that since I need to Google every piece of code. It's impossible to write something out of my own mind from my knowledge of B4A.
I've been programming in VB6 for many many years but today it's too complicated to do anything... I feel like giving up basic and programming...
I tried this update (https://www.b4x.com/android/forum/threads/b4x-xui-customlistview-lazy-loading-virtualization.87930/) to CustomListView but nothing works.
The refered topic (inside the link above) with basic CustomListView works like a charm.
But this 'update' with FillList and FillList2... does nothing.
No errors, no crashes, no views, no pictures, no nothing... just a white screen
I added the subs (FillList2, CLV1_ItemClick, CLV1_VisibleRangeChanged and the new Type).
I have changed nothing in the code, apart from in Activity_Create to be able to run FillLIst.
There I commented the original lines that created the 4 views and replaced them with FillList (and FillList2).
I suppose that's not the way to do it since nothing happens.
How should I do it???
Below is the changes to the sub.
Maybe I'm stupid, it start to feel like that since I need to Google every piece of code. It's impossible to write something out of my own mind from my knowledge of B4A.
I've been programming in VB6 for many many years but today it's too complicated to do anything... I feel like giving up basic and programming...
I tried this update (https://www.b4x.com/android/forum/threads/b4x-xui-customlistview-lazy-loading-virtualization.87930/) to CustomListView but nothing works.
The refered topic (inside the link above) with basic CustomListView works like a charm.
But this 'update' with FillList and FillList2... does nothing.
No errors, no crashes, no views, no pictures, no nothing... just a white screen
I added the subs (FillList2, CLV1_ItemClick, CLV1_VisibleRangeChanged and the new Type).
I have changed nothing in the code, apart from in Activity_Create to be able to run FillLIst.
There I commented the original lines that created the 4 views and replaced them with FillList (and FillList2).
I suppose that's not the way to do it since nothing happens.
How should I do it???
Below is the changes to the sub.
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1")
Activity.AddMenuItem3("", "refresh", xui.LoadBitmapResize(File.DirAssets, "ic_cached_white_24dp.png", 32dip, 32dip, True), True)
Activity.AddMenuItem3("", "done", xui.LoadBitmapResize(File.DirAssets, "ic_done_white_24dp.png", 32dip, 32dip, True), True)
Dim bitmaps As List = Array("pexels-photo-446811.jpeg", "pexels-photo-571195.jpeg", _
"pexels-photo-736212.jpeg", "pexels-photo-592798.jpeg")
' FillList2
' For i = 1 To 4
' Dim content As String = $"Lorem ipsum dolor sit amet,
'consectetur adipiscing elit,
'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."$
' CLV1.Add(CreateItem(CLV1.AsView.Width, $"This is item #${i}"$, bitmaps.Get(i - 1), content), "")
' Next
FillList
End Sub