diff --git a/components/ListPoster.brs b/components/ListPoster.brs index 001f840e..ef4179f5 100644 --- a/components/ListPoster.brs +++ b/components/ListPoster.brs @@ -64,7 +64,8 @@ sub itemContentChanged() as void else if itemData.json.lookup("Type") = "MusicAlbum" m.title.font = "font:SmallestSystemFont" m.staticTitle.font = "font:SmallestSystemFont" - + else + m.series.visible = false end if m.staticTitle.text = m.title.text diff --git a/components/data/SceneManager.brs b/components/data/SceneManager.brs index f621ae4d..0074219e 100755 --- a/components/data/SceneManager.brs +++ b/components/data/SceneManager.brs @@ -8,60 +8,65 @@ end sub ' ' Push a new group onto the stack, replacing the existing group on the screen sub pushScene(newGroup) + currentGroup = m.groups.peek() + if newGroup <> invalid + if currentGroup <> invalid + 'Search through group and store off last focused item + if currentGroup.focusedChild <> invalid + focused = currentGroup.focusedChild + while focused.hasFocus() = false + focused = focused.focusedChild + end while - if currentGroup <> invalid - 'Search through group and store off last focused item - if currentGroup.focusedChild <> invalid - focused = currentGroup.focusedChild - while focused.hasFocus() = false - focused = focused.focusedChild - end while + currentGroup.lastFocus = focused + currentGroup.setFocus(false) + else + currentGroup.setFocus(false) + end if - currentGroup.lastFocus = focused - currentGroup.setFocus(false) + if currentGroup.isSubType("JFGroup") + unregisterOverhangData(currentGroup) + end if + + currentGroup.visible = false + + if currentGroup.isSubType("JFScreen") + currentGroup.callFunc("OnScreenHidden") + end if + + end if + + m.groups.push(newGroup) + + if currentGroup <> invalid + m.content.replaceChild(newGroup, 0) else - currentGroup.setFocus(false) + m.content.appendChild(newGroup) end if - if currentGroup.isSubType("JFGroup") - unregisterOverhangData(currentGroup) + if newGroup.isSubType("JFScreen") + newGroup.callFunc("OnScreenShown") end if - currentGroup.visible = false + 'observe info about new group, set overhang title, etc. + if newGroup.isSubType("JFGroup") + registerOverhangData(newGroup) - if currentGroup.isSubType("JFScreen") - currentGroup.callFunc("OnScreenHidden") - end if - - end if - - m.groups.push(newGroup) - - if currentGroup <> invalid - m.content.replaceChild(newGroup, 0) - else - m.content.appendChild(newGroup) - end if - - if newGroup.isSubType("JFScreen") - newGroup.callFunc("OnScreenShown") - end if - - 'observe info about new group, set overhang title, etc. - if newGroup.isSubType("JFGroup") - registerOverhangData(newGroup) - - ' Some groups set focus to a specific component within init(), so we don't want to - ' change if that is the case. - if newGroup.isInFocusChain() = false + ' Some groups set focus to a specific component within init(), so we don't want to + ' change if that is the case. + if newGroup.isInFocusChain() = false + newGroup.setFocus(true) + end if + else if newGroup.isSubType("JFVideo") newGroup.setFocus(true) + newGroup.control = "play" + m.overhang.visible = false end if - else if newGroup.isSubType("JFVideo") - newGroup.setFocus(true) - newGroup.control = "play" - m.overhang.visible = false + else + currentGroup.focusedChild.setFocus(true) end if + end sub ' @@ -141,7 +146,7 @@ end sub ' ' Clear previous scene from group stack sub clearPreviousScene() - m.groups.pop() + m.groups.Delete(2) end sub ' diff --git a/source/Main.brs b/source/Main.brs index 0124d15b..395cf94a 100644 --- a/source/Main.brs +++ b/source/Main.brs @@ -110,6 +110,7 @@ sub Main (args as dynamic) as void else if isNodeEvent(msg, "selectedItem") ' If you select a library from ANYWHERE, follow this flow selectedItem = msg.getData() + m.selectedItemType = selectedItem.type if selectedItem.type = "CollectionFolder" or selectedItem.type = "UserView" or selectedItem.type = "Folder" or selectedItem.type = "Channel" or selectedItem.type = "Boxset" group = CreateItemGrid(selectedItem) sceneManager.callFunc("pushScene", group) @@ -239,6 +240,7 @@ sub Main (args as dynamic) as void else if isNodeEvent(msg, "episodeSelected") ' If you select a TV Episode from ANYWHERE, follow this flow + m.selectedItemType = "Episode" node = getMsgPicker(msg, "picker") video_id = node.id if node.selectedAudioStreamIndex <> invalid and node.selectedAudioStreamIndex > 1 @@ -268,6 +270,7 @@ sub Main (args as dynamic) as void node = getMsgPicker(msg) ' TODO - swap this based on target.mediatype ' types: [ Series (Show), Episode, Movie, Audio, Person, Studio, MusicArtist ] + m.selectedItemType = node.type if node.type = "Series" group = CreateSeriesDetailsGroup(node) else if node.type = "Movie" @@ -414,7 +417,7 @@ sub Main (args as dynamic) as void end if else if isNodeEvent(msg, "state") node = msg.getRoSGNode() - if selectedItem.Type = "TvChannel" and node.state = "finished" + if m.selectedItemType = "TvChannel" and node.state = "finished" video = CreateVideoPlayerGroup(node.id) m.global.sceneManager.callFunc("pushScene", video) m.global.sceneManager.callFunc("clearPreviousScene")