Listview optimization ?

69 views
Skip to first unread message

noe...@gmail.com

unread,
Feb 21, 2015, 6:50:29 AM2/21/15
to kivy-...@googlegroups.com
Hi all,

Despite all my experiments, I can not optimize listview for displaying long lists (+50 items) on Android.

- Are there any tips about it?
- Are there any plans to improve this control in the next version of Kivy?

Thx for your help !

Alexander Taylor

unread,
Feb 21, 2015, 8:50:16 AM2/21/15
to kivy-...@googlegroups.com
We're aware of the problems with listview, but it's a big task to change it. It will not be significantly changed in the next release, but we do hope to improve it in the future.

You could try creating your own widget optimised to your specific requirements.

noe...@gmail.com

unread,
Feb 22, 2015, 6:34:14 AM2/22/15
to kivy-...@googlegroups.com
Thx for your answer,

I followed your advice and I finally created a new widget that displays my list in 0.004 seconds instead of 8 seconds. I created pages with navigation buttons instead of using a listview.

Have a nice day.

suporte...@gmail.com

unread,
Feb 23, 2015, 6:35:43 AM2/23/15
to kivy-...@googlegroups.com
Hi Noe,

Voce poderia postar um exemplo do seu codigo? 
Eu tambem tem porblemas usando o listview.

Thank's

suporte...@gmail.com

unread,
Feb 23, 2015, 6:40:23 AM2/23/15
to kivy-...@googlegroups.com
Hi Noe,

You could post an example of your code?
I also have porblemas using listview.
Thank's


Em domingo, 22 de fevereiro de 2015 08:34:14 UTC-3, noe...@gmail.com escreveu:

noe...@gmail.com

unread,
Feb 24, 2015, 6:40:47 AM2/24/15
to kivy-...@googlegroups.com
Hello,

Sorry but I can not post the code here because it is more than 900 lines and would require too many adjustments to be used without connection to my database.

But I can tell you the principle of the code:

Must be created:
- A "case" class (derived Button) having an update () function
- A GridLayout that is filled with case "Case" at the opening of the application (must be calculated nobre of displayable lines on the screen).
- A vertical slider on the left side and navigation buttons on the right side.

The data were imported to the database to open the application.

Now create different "virtual pages": A Update () function does this:
1. Assign the lines to each virtual page. Example: dictLinesPerPage [0] = [line1, line2, line] ...
2. Displays the current page by modifying the existing boxes in the GridLayout (with Update function of each box)
3. The navigation buttons and Silder merely modify the current page number and then call the main update function.

Thus, the display is very fast and gives the illusion of a listview.

I hope I have given you some ideas.

Good day
Reply all
Reply to author
Forward
0 new messages