Your Digital Media Has Never Looked So Good

 
namlu
Topic Author
Posts: 8
Joined: Wed Aug 01, 2018 5:53 am

Navigation: How to skip a row or menu item

Wed Aug 01, 2018 7:01 am

Hi all,

I'm working on a menu item feature where an option may sometimes be locked due to device capabilities (e.g. doesn't support UHD content). While I'm able to show a lock icon next to the menu item when appropriate, I would like for the menu selector (using a MarkupList for this) to skip over that menu item when it's locked.

I've tried to set the menu item to focusable = false, but that doesn't seem to work as the user can still navigate over and select it.

Has anyone done something similar that they can share how it was accomplished?
 
joetesta
Posts: 768
Joined: Wed Apr 20, 2011 11:48 am

Re: Navigation: How to skip a row or menu item

Wed Aug 01, 2018 2:35 pm

you could observe the markupList's "itemFocused" field and when it becomes equal to your locked item, set jumpToItem to the next item.
You can probably use the field"itemUnfocused" so you know which direction the user is navigating and determine the appropriate item to jump to.
aspiring
 
namlu
Topic Author
Posts: 8
Joined: Wed Aug 01, 2018 5:53 am

Re: Navigation: How to skip a row or menu item

Wed Aug 01, 2018 4:24 pm

Hi @joetesta,

Thank you for your response.

Would you have to have some sample code for implementing a similiar feature? I've discussed this option w colleagues and implementation sounds quite challenging for something that shouldn't be.
 
joetesta
Posts: 768
Joined: Wed Apr 20, 2011 11:48 am

Re: Navigation: How to skip a row or menu item

Thu Aug 02, 2018 8:05 am

dam it i wrote the code example then this forum told me to log in again and everything I wrote is lost :(
aspiring
 
namlu
Topic Author
Posts: 8
Joined: Wed Aug 01, 2018 5:53 am

Re: Navigation: How to skip a row or menu item

Thu Aug 02, 2018 5:27 pm

Argh!!! So frustrating. Thanks @joetesta, I appreciate the effort.

If you do have the time, can you please try to repost?
 
joetesta
Posts: 768
Joined: Wed Apr 20, 2011 11:48 am

Re: Navigation: How to skip a row or menu item

Fri Aug 03, 2018 7:35 am

yes sorry was meaning to do this last night before I fell asleep,
in init()

  m.markuplist = m.top.findnode("markupListID")
  m.markuplist.observeField("itemFocused", "focusChanged")
  m.lockedIndex = 3
end sub

sub focusChanged()
  itemFocused = m.markuplist.itemFocused
  if itemFocused = m.lockedindex
    'skip the locked item'
    nextItem = invalid
    if itemFocused > m.markuplist.itemUnfocused and itemFocused < m.markuplist.content.getChildCount() - 1
      nextItem = itemFocused + 1
    else if itemFocused < m.markuplist.itemUnfocused and itemFocused > 0
      nextItem = itemFocused - 1
    end if
    if nextItem <> invalid
      m.markuplist.jumpToItem = nextItem
    end if
  end if
end sub

You could add logic to bounce them back one if the locked item is at the end or beginning.  You could have an array of locked items and further complicate things.
This is just one way to do it, another way would be for each itemComponent to observe its own focusPercent and have a field to know if it's "locked" then react by setting it's parent's jumpToItem.  Don't know whether it'd be better ?
aspiring
 
namlu
Topic Author
Posts: 8
Joined: Wed Aug 01, 2018 5:53 am

Re: Navigation: How to skip a row or menu item

Sat Aug 04, 2018 7:02 pm

Awesome, thank you @joetesta! I'll give it a go and let you know how it goes. 

I'll have each item be able to react as the list of menu items could vary.

Who is online

Users browsing this forum: No registered users and 4 guests