Detect on-item-change in a fixed list?
#1
As the title says, is there any way to detect when an item inside a fixedlist is changed focus? The <onfocus> tag for the fixed list only works when the whole fixedlist first takes focus.

My goal is to store things about the specific item into window properties so that I can recall that information when the fixedlist loses focus. I'm going for a sort of Netflix themed skin where after browsing through media posters, if I go back to the main menu, the last browsed item's information still remains in the background while my main menu is up.

I cant use Container({myFixedListID}).ListItem because I'm using skinshortcuts to generate dynamic fixedlists with unique IDs and it's just one of several lists that could have been last focused. Instead I figured a good approach would be to <onitemchange> set the respective window property with that ListItem's info but unfortunately there does not exist such a tag that I know of.

I'd appreciate any suggestions or ideas to go about accomplishing this.
Reply
#2
You can hack it by having a button control in your <focuseditem>. The button's <onfocus> tag will trigger every time a new item takes focus, so you can add your SetProperty commands to onfocus tags in the button to achieve what you need.

It's even possible to add a delay, if for example you wanted to complete an action a set period after an item takes focus. You just need to add an animation that doesn't do anything and set the time to the delay you want to add before the actions. This is because animations will run before <onfocus>.

So a slide animation with a time of "360" and an end of "0, 0" wouldn't do anything but would delay your onfocus actions by 360ms.

This method is very effective and a lot of skins use it but it is technically a 'hack' that will give you warnings in the log ("unsupported control type 1").

I've looked into a lot of the old forum posts on this and consensus seems to be that these warnings are harmless and that there is no perceptible performance penalty.

The alternative would be to use skin timers on Kodi nexus which you can use to effectively create a monitor service. But skin timers are checked every 500ms so if you need something to happen instantly after a new item takes focus, you'll need to use the button method. If it's less time sensitive a skin timer might be better
Reply

Logout Mark Read Team Forum Stats Members Help
Detect on-item-change in a fixed list?0