This is normal behavior, actually. There are a couple of things that are resulting in multiple calls to update()
.
1) The ListView
validates twice. This will lead to update()
being called at least twice for each item renderer too.
First, VerticalLayout
used by the Application
needs to validate the ListView
once to get its ideal height measurement. Though you set percentHeight
to 100.0
, the final calculated height may be affected by the heights of other children in the container. Later, when percentHeight
is used to calculate the final height of the ListView
, the ListView
needs to validate a second time. I suppose that VerticalLayout
could be optimized for the case where only one child is added to the container, but honestly, it's not really that expensive.
If the ListView
will be the only child in the container, you may be able to use a different layout instead of VerticalLayout
in the Application
, if you want to avoid the second validation. AnchorLayout
might be a good choice because it also supports percentWidth
and percentHeight
.
2) When a scrolling container (such as a ListView
) validates, it needs to measure its content to determine whether scroll bars are required or not. This tends to be more expensive on desktop than on mobile because desktop scroll bars force the content to be resized when they are displayed, while mobile scroll bars are simply displayed on top of the content without resizing it.
Validating a scrolling container basically has two passes. First, to measure the content, which involves determining whether scroll bars are required or not. Then, to apply the final layout based on the scroll bars. Due to certain quirks that I'm not going to dive into right now, it may measure the content twice before applying the final layout. So that's actually three passes. 3 * 2 = 6.
For some reason, the first validation of the ListView
needs an extra measurement and layout. I don't have time to explain exactly why this is happening, but this results in two more calls to update()
. 6 + 2 = 8. (It may be possible for me to optimize away these last 2 updates in a future version of Feathers UI, actually).