Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
kyleabaker
Level 7

GetThemeAttribute or something similar?

Is there a way to retrieve theme attributes that have been applied? For instance, can I find the value of "GridScreenLogoHD" (which should just be a path to an image)?
0 Kudos
2 Replies
TheEndless
Level 7

Re: GetThemeAttribute or something similar?

None that I'm aware of... I use the following to manage my themes via an object stored in the Global AA.

Sub SetTheme(theme As Object)
m.Theme = theme
app = CreateObject("roAppManager")
app.SetTheme(m.Theme)
End Sub

Function GetTheme() As Object
If m.Theme = invalid Then
m.Theme = {}
End If
Return m.Theme
End Function

Sub SetThemeAttribute(name As String, value As String)
app = CreateObject("roAppManager")
app.SetThemeAttribute(name, value)

theme = GetTheme()
theme[name] = value
End Sub

Function GetThemeAttribute(name As String, defaultValue = "" As String) As String
theme = GetTheme()
value = theme[name]
If IsNullOrEmpty(value) Then
value = defaultValue
End If
Return value
End Function

Sub ClearThemeAttribute(name)
app = CreateObject("roAppManager")
app.ClearThemeAttribute(name)

theme = GetTheme()
theme.Delete(name)
End Sub
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
kyleabaker
Level 7

Re: GetThemeAttribute or something similar?

"TheEndless" wrote:
None that I'm aware of... I use the following to manage my themes via an object stored in the Global AA.

Sub SetTheme(theme As Object)
m.Theme = theme
app = CreateObject("roAppManager")
app.SetTheme(m.Theme)
End Sub

Function GetTheme() As Object
If m.Theme = invalid Then
m.Theme = {}
End If
Return m.Theme
End Function

Sub SetThemeAttribute(name As String, value As String)
app = CreateObject("roAppManager")
app.SetThemeAttribute(name, value)

theme = GetTheme()
theme[name] = value
End Sub

Function GetThemeAttribute(name As String, defaultValue = "" As String) As String
theme = GetTheme()
value = theme[name]
If IsNullOrEmpty(value) Then
value = defaultValue
End If
Return value
End Function

Sub ClearThemeAttribute(name)
app = CreateObject("roAppManager")
app.ClearThemeAttribute(name)

theme = GetTheme()
theme.Delete(name)
End Sub


That's a nice workaround, thanks!
0 Kudos