Changing colours inside a list
#1
Need a bit of help here !!

I can change the colours inside a list programatically (script embeds [COLOR=XXXXXXXX] into the listitem) but I want/need to be able to do it in the skin file instead.

So, my question is - How do I produce the same effect as this, just using XML ?

Image

I need to be able to change the colour of each listitem, based on the contents of that listitem. Currently, my list is defined as follows and is populated by the script.
PHP Code:
<control type="list" id="12">    
            <
viewtype label="list_4">list</viewtype>
            <
left>1480</left>
            <
top>380</top>
            <
width>200</width>
            <
height>401</height>
            <
orientation>vertical</orientation>
            <
itemlayout height="30">
                <
control type="label">
                    <
left>68</left>
                    <
top>0</top>
                    <
width>150</width>
                    <
height>28</height>
                    <
font>font10</font>
                    <
aligny>center</aligny>
                    <
label>$INFO[ListItem.Label]</label>
                </
control>
            </
itemlayout>
            <
focusedlayout height="30">
                <
control type="label">
                    <
left>68</left>
                    <
top>0</top>
                    <
width>150</width>
                    <
height>28</height>
                    <
font>font10</font>
                    <
aligny>center</aligny>
                    <
label>$INFO[ListItem.Label]</label>
                </
control>
            </
focusedlayout>
        </
control

I have tried the small amount of skinning that I know, but to no avail unfortunately. All I have managed to do so far is either make that text disappear or make it all a uniform colour. Sad

Thanks for any help/advice anyone can give me........This skinning stuff really isn't easy !!
Learning Linux the hard way !!
Reply
#2
See one possible solution here...

http://forum.kodi.tv/showthread.php?tid=...pid2464095

I wanted to use a variable, but then the labels disappeared. Ended up just duplicating the label control and setting visibility according to its contents.
Reply
#3
Visibility conditions is the way to go. I think with skin.helper.service you can use variables in a list as well.
Aussie, Aussie, Aussie, Oi, Oi, Oi

Don't forget the Thank User button if i have helped!
|
V
Reply
#4
http://kodi.wiki/view/Radio_button_control
XBoxMediaCenter (Kodi Matrix ) 19.3 , AndroidBox -Matrix Skin AeonMQ6
Reply
#5
Yeah, I ended up going with the visibility condition. I'd actually tried this already before I asked the question but for whatever reason, I couldn't get it working with StringCompare. SubString works fine though Smile
Learning Linux the hard way !!
Reply
#6
(2016-11-27, 09:43)black_eagle Wrote: Yeah, I ended up going with the visibility condition. I'd actually tried this already before I asked the question but for whatever reason, I couldn't get it working with StringCompare. SubString works fine though Smile
Just FYI, substring and stringcompare are deprecated in Kodi 17. The new ones are String.IsEqual and String.Contains. The old way will probably still work for now but be completely removed in Kodi 18.
Reply
#7
(2016-11-27, 10:38)braz Wrote: Just FYI, substring and stringcompare are deprecated in Kodi 17. The new ones are String.IsEqual and String.Contains. The old way will probably still work for now but be completely removed in Kodi 18.

Yeah, this will become a problem with Kodi 18 as the add-on works with all versions of Kodi/XBMC after Frodo but I guess I'll worry about that in the future Laugh Ideally, Kodi would be able to pick the right version to install from a repo but I'm not sure if that's possible. There are other ways of handling it though if not.
Learning Linux the hard way !!
Reply

Logout Mark Read Team Forum Stats Members Help
Changing colours inside a list0