Setting focus or scrolling position on specific listitem in a directory
#1
I feel like this is a simple soluton but I can't quite find an answer.  I have an addon which creates a directory of listitems which the number of listitems can vary.  Many times it may have over 100 items in the directory and I want to have say item 68 be the first positioned item on the screen when the the directory of listitems becomes visible.  The user can scroll up if they want to see 1-67.  I've seen some potential solutions with customer windows but I think I am missing somthing easy / obvious.. 

This is a standard Kodi video window with nothing special.  I know the position each time I want to be positioned on but I can't figure out how to focus or position on the specific listitem so if the target item is say item 68 out of 100 that the user has to start at position 0 and page down 3-4 times to get to 68.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#2
Quote:Control.SetFocus(id,position[,absolute])

Will make a list with the "id" specified in the command gain focus at "position" number in its list. Set absolute to focus the first listitem of a container instead of the first visible listitem. Alias SetFocus(id,position)
Reply
#3
(2024-02-20, 02:08)Hitcher Wrote: Control.SetFocus(id,position[,absolute])

Will make a list with the "id" specified in the command gain focus at "position" number in its list. Set absolute to focus the first listitem of a container instead of the first visible listitem. Alias SetFocus(id,position)

OK Thanks.  I had seen this and think I got confused, not being a skinner, on whether I need find the existing control / contained id which is holding the listitems or I create my own id ?  Looking at the Confluence skin it looks like the control id / container may be 50.  Or is there a command I issue to get the control id ?

Sorry, I realize these are very basic questions.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#4
Quickest way would be to edit the skin's addon.xml and change debugging="false" to debugging="true" and you should then see the id of the list.
Reply
#5
(2024-02-20, 11:01)Hitcher Wrote: Quickest way would be to edit the skin's addon.xml and change debugging="false" to debugging="true" and you should then see the id of the list.

I see the value is based upon the container view mode and content type.  I do grab those values in the addon to do view mapping by media / content type but there isn't a way to do a get controlId function or similar  ?  I suppose maybe this may be why folks use custom windows to control  this across skins.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
Setting focus or scrolling position on specific listitem in a directory0