Kodi Community Forum

Full Version: Center the contents in a list control (Frodo)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm playing around with the foundation skin (Frodo, since none of the OE 4 updates works on my system Sad)

I'm currently customizing the home window and have changed the orientation of the main list to horizontal instead of vertical. I've also changed the control type from 'wrap list' to 'list'. Now I'm trying to figure out the best way to make the contents always align to center, no matter how many items there are.

I have seen some similar discussions which brought up using <left> tags but they seems to have no effect, no matter if I put them inside the list control or inside the item layouts. Seems to be the same with the <align> tags. I also tried putting the whole list inside a group list and putting the <align> tag inside the group list control, no effect. Here's what the code looks like now:

Code:
        <control type="list" id="300">
            <description>Home Wraplist</description>
            <posy>50</posy>
            <width>1280</width>
            <height>172</height>
            <onup>300</onup>
            <ondown>300</ondown>
            <onleft>300</onleft>
            <onright>300</onright>
            <focusposition>2</focusposition>
            <orientation>horizontal</orientation>
            <scrolltime>200</scrolltime>

            <itemlayout width="172" height="172">
                <control type="image">
                <height>90</height>
                <colordiffuse>77FFFFFF</colordiffuse>
                <texture align="center" aligny="center">$INFO[ListItem.Icon]</texture>
                </control>

            </itemlayout>
            
            <focusedlayout width="172" height="172">
                <control type="image">
                <height>90</height>
                <colordiffuse>DDFFFFFF</colordiffuse>
                <texture align="center" aligny="center">$INFO[ListItem.Icon]</texture>
                </control>

            </focusedlayout>

            <content>...........</content>
        </control>

I saw someone post something about using animations but is that the best way to achieve this?
Animations based on the number of items in the container seems to be the best way to me. The only way actually I think.
I see! I haven't yet had time to learn about animations, so I'll look into that. Would you say that animations are a source of high cpu usage? BTW, thanks for the quick reply. It seems that these forums are more in sync with my time zone than what I'm used to!
No, I don't suspect they'll have a large effect. Not in this case anyway. Essentially what you're going to be doing isn't really animating stuff (you just set the animation time to 0), just using the animation effects to reposition the controls.