list_size callback #
Demo
- Example 1: Try on your phone
- Example 2: Try on your phone
- The number of list size is based on where the callback is called. On example code 1, rather than return number 5, which is the amount of MenuItem, the callback return 3 as result.
- On SnomIPPhoneText on example code 2, this is not limited when the line is differentiate by
<br/>
. The lorem ipsum text add more additional lines and make the list_size callback return 6 as result.
Example 1: Get list size of simple MenuItem
<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneMenu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../minibrowser_test.xsd">
<MenuItem name="line1"></MenuItem>
<MenuItem name="line2"></MenuItem>
<MenuItem name="line3"></MenuItem>
<MenuItem name="list_size:$(list_size)"></MenuItem><!-- list_size:3-->
<MenuItem name="line5"></MenuItem>
</SnomIPPhoneMenu>
Example 2: Get list size of simple MenuItem
<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneText xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../minibrowser_test.xsd">
<Text>
line1<br />
line2<br />
lorem ipusfjsaöljkfsaölj
lkfölsdajföl jfö jfkj aöfjs
jfödajföj aölj öojsfdjsdkfjöldfj<br />
list_size:$(list_size)
</Text><!-- list_size:6 -->
</SnomIPPhoneText>