Kodi Community Forum

Full Version: How to have List with different width and position depending on content type?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

I apologize in advance for the noob question, I am a WIP skinner stil.  I am migrating the Amber skin to Leia, and have come across the issue of trying to have a list control for the list view have different widths and start at a different x position depending on content.  Initially the code had two list controls with the same ID and different width and posx, with visibility condition for the content type.  This did not work, and only the first list control was being shown (when its visibility conditions were met) and the second list control was not shown.

I am trying the following code, but it doesn't work either, the list always has the first width defined and at the first posx defined:

            <control type="list" id="50">
                <viewtype label="$LOCALIZE[535]">list</viewtype>
                <posx condition="![Container.content(addons) | Container.Content(albums) | Container.Content(artists) | Container.Content(episodes) | Container.Content(movies) | Container.Content(musicvideos) | Container.Content(seasons) | Container.Content(sets) | Container.Content(tvshows)]">555</posx>                
                <posx condition="[Container.content(addons) | Container.Content(albums) | Container.Content(artists) | Container.Content(episodes) | Container.Content(movies) | Container.Content(musicvideos) | Container.Content(seasons) | Container.Content(sets) | Container.Content(tvshows)]">1250</posx>
                <posy>351</posy>
                <width condition="![Container.content(addons) | Container.Content(albums) | Container.Content(artists) | Container.Content(episodes) | Container.Content(movies) | Container.Content(musicvideos) | Container.Content(seasons) | Container.Content(sets) | Container.Content(tvshows)]">1365</width>
                <width condition="[Container.content(addons) | Container.Content(albums) | Container.Content(artists) | Container.Content(episodes) | Container.Content(movies) | Container.Content(musicvideos) | Container.Content(seasons) | Container.Content(sets) | Container.Content(tvshows)]">640</width>                
                <height>700</height>
                <pagecontrol>60</pagecontrol>
                <onleft>9000</onleft>
                <onright>60</onright>
                <onup>50</onup>
                <ondown>50</ondown>
                <preloaditems>4</preloaditems>
                <include content="View_50_List"></include>
            </control>

I would really appreciate any help in how to accomplish this.  Thanks.

Regards,

Bart
you can use params or 
Code:
<include name='altWidth'>
    <width>XXX</width>
</include>

then place it on top of the default like this:
Code:
...
<include condition='your_condition'>altWidth</include>
<width>DefaultWidthGoesHere</width>
...

this however will only change on window reload. so it depends on your needs.
to change it on-demand you can only use different item/focusedlayout width and heights.
Code:
<itemlayout width='default' height='default' condition='condition'>
...</itemlayout>
<itemlayout width='altwidth' height='altheight' condition='!condition'>
...
</itemlayout>
(2019-03-20, 19:47)cartman.dos Wrote: [ -> ]you can use params or 
Code:
<include name='altWidth'>
    <width>XXX</width>
</include>

then place it on top of the default like this:
Code:
...
<include condition='your_condition'>altWidth</include>
<width>DefaultWidthGoesHere</width>
...

this however will only change on window reload. so it depends on your needs.
to change it on-demand you can only use different item/focusedlayout width and heights.
Code:
<itemlayout width='default' height='default' condition='condition'>
...</itemlayout>
<itemlayout width='altwidth' height='altheight' condition='!condition'>
...
</itemlayout>
Thanks! I will see if I can make it work the way you describe.

Regards,

Bart
@cartman.dos , I followed your advice with multiple item/focusedlayouts, and now I got it working.  Thanks again!

Regards,

Bart