SayCheese Member Licensed User Sep 16, 2019 #1 I used the cardslist demo (https://www.b4x.com/android/forum/threads/cards-list-with-customlistview.87720/#content) and lazyloading demo code snippits (https://www.b4x.com/android/forum/threads/b4x-xui-customlistview-lazy-loading-virtualization.87930/) to overcome jerky scrolling when more items are loaded with CLV. Somehow it doesn't seem to work on my phone above 500-600 items to get it smooth. Can anyone explain why? Attachments cardview_lazyloading.zip cardview_lazyloading.zip 115 KB · Views: 283
I used the cardslist demo (https://www.b4x.com/android/forum/threads/cards-list-with-customlistview.87720/#content) and lazyloading demo code snippits (https://www.b4x.com/android/forum/threads/b4x-xui-customlistview-lazy-loading-virtualization.87930/) to overcome jerky scrolling when more items are loaded with CLV. Somehow it doesn't seem to work on my phone above 500-600 items to get it smooth. Can anyone explain why?
Erel B4X founder Staff member Licensed User Longtime User Sep 16, 2019 #2 Please upload the project. There are all kinds of levels of "lazy loading". Also make sure to test it in release mode. Upvote 0
Please upload the project. There are all kinds of levels of "lazy loading". Also make sure to test it in release mode.
Erel B4X founder Staff member Licensed User Longtime User Sep 16, 2019 #4 Your project runs very smooth on the device I tested it. I didn't test it with a weaker device. Still I made some optimizations that can help. 1. Reuse bitmaps instead of loading a new one each time. 2. Reuse the items layouts. Attachments cardview_lazyloading.zip cardview_lazyloading.zip 115.1 KB · Views: 336 Upvote 0
Your project runs very smooth on the device I tested it. I didn't test it with a weaker device. Still I made some optimizations that can help. 1. Reuse bitmaps instead of loading a new one each time. 2. Reuse the items layouts.
SayCheese Member Licensed User Sep 16, 2019 #5 It still isn't smooth. My phone has a sd625/3gb of memory. On a sd625/4gb it didn't run smoother either. But a sd660/4gb i just tested, it did run smooth. Upvote 0
It still isn't smooth. My phone has a sd625/3gb of memory. On a sd625/4gb it didn't run smoother either. But a sd660/4gb i just tested, it did run smooth.
Erel B4X founder Staff member Licensed User Longtime User Sep 16, 2019 #6 SayCheese said: My phone has a sd625/3gb of memory Click to expand... Which phone? Can you record a video? Upvote 0
SayCheese said: My phone has a sd625/3gb of memory Click to expand... Which phone? Can you record a video?
SayCheese Member Licensed User Sep 16, 2019 #7 It's a Xiaomi Redmi A2 lite. I never have issues with jerkiness or stutters on this phone. The Video is too big to upload for the server although it's only 3 mb Last edited: Sep 16, 2019 Upvote 0
It's a Xiaomi Redmi A2 lite. I never have issues with jerkiness or stutters on this phone. The Video is too big to upload for the server although it's only 3 mb
SayCheese Member Licensed User Sep 16, 2019 #8 On the video perhaps it's not that obvious. I didn't want to scroll harder because I didn't know if it was recorded well. Edit: I shot a better one. Last edited: Sep 16, 2019 Upvote 0
On the video perhaps it's not that obvious. I didn't want to scroll harder because I didn't know if it was recorded well. Edit: I shot a better one.
Erel B4X founder Staff member Licensed User Longtime User Sep 17, 2019 #9 Doesn't look too bad. Several notes: 1. This is a low end device. It will be smoother on more powerful devices. 2. There is no good reason to create a list with 1000 cards. The list is very long and no user will want to scroll all these items. You should instead let the user filter the list in some way. Upvote 0
Doesn't look too bad. Several notes: 1. This is a low end device. It will be smoother on more powerful devices. 2. There is no good reason to create a list with 1000 cards. The list is very long and no user will want to scroll all these items. You should instead let the user filter the list in some way.
SayCheese Member Licensed User Sep 17, 2019 #10 1. To me it looks really bad. A sd625 is very well capable delivering a fluid experience. I don't think that's the issue. 2. I understand that a 1000 item list isn't practical. But lists grow over time and when the user decides not to filter when displaying the whole list for what ever reason, it's a good thing I don't have to worry about performance issues. It was just that Listview and Ultimate Listview do deliver a smooth experience. I will make another question for having columns in a listview as you mentioned before. I already tried that but I couldn't get it right without monospacetyped fonts which makes it a lot easier of course. Upvote 0
1. To me it looks really bad. A sd625 is very well capable delivering a fluid experience. I don't think that's the issue. 2. I understand that a 1000 item list isn't practical. But lists grow over time and when the user decides not to filter when displaying the whole list for what ever reason, it's a good thing I don't have to worry about performance issues. It was just that Listview and Ultimate Listview do deliver a smooth experience. I will make another question for having columns in a listview as you mentioned before. I already tried that but I couldn't get it right without monospacetyped fonts which makes it a lot easier of course.
Erel B4X founder Staff member Licensed User Longtime User Sep 17, 2019 #11 There is a difference between a list with 1000 items and a list with 1000 cards. The cards are relatively tall and hold a more complex layout. BTW, you should try to decrease ExtraSize in the visible range changed event to 1 or 2. It can help. There is never a good reason to add 1000 cards to a list. You should instead start with a shorter list and add more items if the user ever reaches its end (there is an event for this case). SayCheese said: It was just that Listview and Ultimate Listview do deliver a smooth experience. Click to expand... ListView is not relevant as it doesn't support such layouts. If ULV works better for you then you should use it. Upvote 0
There is a difference between a list with 1000 items and a list with 1000 cards. The cards are relatively tall and hold a more complex layout. BTW, you should try to decrease ExtraSize in the visible range changed event to 1 or 2. It can help. There is never a good reason to add 1000 cards to a list. You should instead start with a shorter list and add more items if the user ever reaches its end (there is an event for this case). SayCheese said: It was just that Listview and Ultimate Listview do deliver a smooth experience. Click to expand... ListView is not relevant as it doesn't support such layouts. If ULV works better for you then you should use it.
SayCheese Member Licensed User Sep 17, 2019 #12 There is never a good reason to add 1000 cards to a list Click to expand... Perhaps I don't understand the card-principle, but if I want a somewhat more complex layout as a listview-layout, you could call it a card isn't it? If ULV works better for you then you should use it. Click to expand... In the testproject I provided in my 'android question' the events of ULV are not triggered but no one seems to have the answer. So that's no option although the ULV is very powerful. I guess CLV is the only option. Upvote 0
There is never a good reason to add 1000 cards to a list Click to expand... Perhaps I don't understand the card-principle, but if I want a somewhat more complex layout as a listview-layout, you could call it a card isn't it? If ULV works better for you then you should use it. Click to expand... In the testproject I provided in my 'android question' the events of ULV are not triggered but no one seems to have the answer. So that's no option although the ULV is very powerful. I guess CLV is the only option.
moster67 Expert Licensed User Longtime User Sep 17, 2019 #13 I tend to agree with Erel and his comments. Anyway, there is another alternative, although payable, i.e. Amir_RecyclerView which you can find here: https://www.b4x.com/android/forum/threads/lib-chargeable-amir_recyclerview.97274/ Upvote 0
I tend to agree with Erel and his comments. Anyway, there is another alternative, although payable, i.e. Amir_RecyclerView which you can find here: https://www.b4x.com/android/forum/threads/lib-chargeable-amir_recyclerview.97274/
SayCheese Member Licensed User Sep 17, 2019 #14 moster67 said: I tend to agree with Erel and his comments. Anyway, there is another alternative, although payable, i.e. Amir_RecyclerView which you can find here: https://www.b4x.com/android/forum/threads/lib-chargeable-amir_recyclerview.97274/ Click to expand... Looks impressive but the functionality it offers is a bit less impressive. I think ULV is the better choice as far I can tell. Informix, solved the issue I had. It was very minor, a user mistake as I already thought. Last edited: Sep 18, 2019 Upvote 0
moster67 said: I tend to agree with Erel and his comments. Anyway, there is another alternative, although payable, i.e. Amir_RecyclerView which you can find here: https://www.b4x.com/android/forum/threads/lib-chargeable-amir_recyclerview.97274/ Click to expand... Looks impressive but the functionality it offers is a bit less impressive. I think ULV is the better choice as far I can tell. Informix, solved the issue I had. It was very minor, a user mistake as I already thought.