Skip to content

Commit 9e4e37f

Browse files
committed
Update code docs
1 parent 5accdee commit 9e4e37f

3 files changed

Lines changed: 12 additions & 29 deletions

File tree

docs/components_music_ArtistView.bs.html

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
m.sectionScroller.observeField("displayedIndex", "onSectionScrollerChange")
2828
m.overhang = m.top.getScene().findNode("overhang")
2929

30-
' Load background image
31-
m.LoadBackdropImageTask = CreateObject("roSGNode", "LoadItemsTask")
32-
m.LoadBackdropImageTask.itemsToLoad = "backdropImage"
33-
34-
m.backDrop = m.top.findNode("backdrop")
3530
m.artistImage = m.top.findNode("artistImage")
3631
m.dscr = m.top.findNode("overview")
3732
m.dscr.ellipsisText = tr("... (Press * to read more)")
@@ -59,6 +54,11 @@
5954
end sub
6055

6156
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+
6262
if m.sectionScroller.displayedIndex = 0
6363
' User is on the top section with artist info and buttons
6464
m.buttonGrp.callFunc("focus")
@@ -136,10 +136,10 @@
136136
sub pageContentChanged()
137137
item = m.top.pageContent
138138

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
143143

144144
' Populate scene data
145145
setScreenTitle(item.json)
@@ -160,24 +160,7 @@
160160
m.artistImage.uri = posterURL
161161
end sub
162162

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
181164
sub artistOverviewChanged()
182165
overviewContent = m.top.artistOverview
183166

docs/data/search.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-ArtistView.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)