|
27 | 27 | m.sectionScroller.observeField("displayedIndex", "onSectionScrollerChange") |
28 | 28 | m.overhang = m.top.getScene().findNode("overhang") |
29 | 29 |
|
30 | | - ' Load background image |
31 | | - m.LoadBackdropImageTask = CreateObject("roSGNode", "LoadItemsTask") |
32 | | - m.LoadBackdropImageTask.itemsToLoad = "backdropImage" |
33 | | - |
34 | | - m.backDrop = m.top.findNode("backdrop") |
35 | 30 | m.artistImage = m.top.findNode("artistImage") |
36 | 31 | m.dscr = m.top.findNode("overview") |
37 | 32 | m.dscr.ellipsisText = tr("... (Press * to read more)") |
|
59 | 54 | end sub |
60 | 55 |
|
61 | 56 | sub OnScreenShown() |
| 57 | + ' Restore backdrop when returning to this screen |
| 58 | + if isValid(m.top.pageContent) and isValid(m.top.pageContent.backdropUrl) |
| 59 | + m.global.sceneManager.callFunc("setBackgroundImage", m.top.pageContent.backdropUrl) |
| 60 | + end if |
| 61 | + |
62 | 62 | if m.sectionScroller.displayedIndex = 0 |
63 | 63 | ' User is on the top section with artist info and buttons |
64 | 64 | m.buttonGrp.callFunc("focus") |
|
136 | 136 | sub pageContentChanged() |
137 | 137 | item = m.top.pageContent |
138 | 138 |
|
139 | | - ' Use metadata to load backdrop image |
140 | | - m.LoadBackdropImageTask.itemId = item.json.id |
141 | | - m.LoadBackdropImageTask.observeField("content", "onBackdropImageLoaded") |
142 | | - m.LoadBackdropImageTask.control = "RUN" |
| 139 | + ' Set backdrop using app-wide BackdropFader via sceneManager |
| 140 | + if isValid(item) and isValid(item.backdropUrl) |
| 141 | + m.global.sceneManager.callFunc("setBackgroundImage", item.backdropUrl) |
| 142 | + end if |
143 | 143 |
|
144 | 144 | ' Populate scene data |
145 | 145 | setScreenTitle(item.json) |
|
160 | 160 | m.artistImage.uri = posterURL |
161 | 161 | end sub |
162 | 162 |
|
163 | | -sub onBackdropImageLoaded() |
164 | | - data = m.LoadBackdropImageTask.content[0] |
165 | | - m.LoadBackdropImageTask.unobserveField("content") |
166 | | - if isValid(data) and data <> "" |
167 | | - setBackdropImage(data) |
168 | | - end if |
169 | | -end sub |
170 | | - |
171 | | -' Add backdrop image to screen |
172 | | -sub setBackdropImage(data) |
173 | | - if isValid(data) |
174 | | - if m.backDrop.uri <> data |
175 | | - m.backDrop.uri = data |
176 | | - end if |
177 | | - end if |
178 | | -end sub |
179 | | - |
180 | | -' Event fired when page data is loaded |
| 163 | +' Event fired when artist overview data is loaded |
181 | 164 | sub artistOverviewChanged() |
182 | 165 | overviewContent = m.top.artistOverview |
183 | 166 |
|
|
0 commit comments