Conditional Height
#1
I have a fixedlist control of about 800 lines which I want to display with different heights, based on Container.Content. Normally, I would have used conditional includes but since includes cannot resolve Container.Content, I am in need of a different approach. 

Many years ago, the only way was to have different controls for each condition, but I am hoping that someone has identified a better way; I would hate to have to duplicate 800 lines of definition.
Reply
#2
It's still valid. Happy duplicating Wink

But you can use the param feature. https://kodi.wiki/view/Skinning_Manual#Nested

Definition
Code:

<include name="MyFixedlist">
<param name="height">800</heigth>
<definition>
<control type="fixedlist">
<height>$PARAM[height]</height>
...
..
</control>
</definition>
</include>

Call
Code:

<include content="MyFixedlist" condition="Container.Content(movies)">
<param name="height" value="500"/>
</include>

<include content="MyFixedlist" condition="Container.Content(tvshows)">
<param name="height" value="600"/>
</include>

<include content="MyFixedlist" condition="Container.Content(music)">
<param name="height" value="900"/>
</include>

...
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#3
Thanks @sualfred for replying. I did what you proposed:
xml:

<?xml version="1.0" encoding="UTF-8"?>
<includes>
    <include name="VideoLowList">
        <control type="group">
            ...
            <include content="LowListFixedList" condition="Container.Content(episodes)">
                <param name="height">517</param>
                <param name="movement">6</param>
            </include>
            <include content="LowListFixedList" condition="!Container.Content(episodes)">
                <param name="height">347</param>
                <param name="movement">4</param>
            </include>
        </control>
    </include>
    
    <include name="LowListFixedList">
        <param name="height">517</param>
        <param name="movement">6</param>
        <definition>
            <height>$PARAM[height]</height>
            <movement>$PARAM[movement]</movement>
             ....
        </definition>
    </include>
</includes>


Sadly it didn't work. Container.Content(episodes) is always evaluated as false and the 347 is used for height. Could it be related to this? Am I doing something wrong?

PS to bypass the limitation of include, I tried to employ a hack by setting a label string and checking its value in the condition attribute; that didn't work either.
Reply
#4
I don't know your complete code and structure, but I guess it happened when you were on a tv show or season level before. 
Kodi does not render the includes in the media windows again when the page content is changed to episodes or to any other path. It just updates the container path. In that case you have to work with visible conditions, conditional item and focused layouts and/or additional view types.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#5
That is what I deduced too. To summarize:
  • Skins cannot use conditions for height.
    • To work around that, conditional includes can be employed but skins cannot use Container in the condition attribute of includes.
      • To work around that, skins need to use multiple includes and manage with the visible attribute but if their controls have ids things fall apart.
        • To work around that, skinners need to change the ids and over-complicate every condition where that id is used
    • Another workaround is to simply create entirely different views which only differ in one control's height; they would name them LowList Short, LowList Tall, LowList Medium! No

Meaning skins cannot have dynamic heights for different Container.Content without drastically complicating the markup. No wonder @phil65 was begging for it.

Has anyone come up with a better way of doing this? Do you know a skin that has succeeded in solving this problem differently?
Reply
#6
Wrong, My Example works if a window is going to reload. You can try it on your own by going to a epsiode level and force the skin to reload. 

It's pretty much easy  to get it working for you. Just define another view for each wanted and possible height.


Code:

        <control type="fixedlist" id="50">
            <visible>Container.Content(episodes)</visible>
            <height>500</height>
            <include content="Layout">
                <param name="ID" value="50"/>
                .... (and other required params) ....
            </include>
        </control>
        <control type="fixedlist" id="51">
            <visible>!Container.Content(episodes)</visible>
            <height>700</height>
            <include content="Layout">
                <param name="ID" value="51"/>
                .... (and other required params) ....
            </include>
        </control>
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#7
I think I got what you mean; correct me please if I misunderstood. You are proposing to either use separate views, or pass the id down.

I was hoping not to have to duplicate an entire view just for a height difference. On passing down using params, unfortunately the conditions that check the view are not inside the fixedlist but rather outside it in different xml files; does the param I set here get to them?


PS for now I just duplicated the ids and changed all my conditions. It would be a nightmare to manage this and I am hoping to find a cleaner solution.
Reply
#8
In my example you don't have to duplicate codes. Just include the layout code and use params to provide the ID to change conditions for all Container($PARAM[id]).xxx.xxx values.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#9
Thanks. I will try your proposal over the weekend and will report back.
Reply

Logout Mark Read Team Forum Stats Members Help
Conditional Height0