Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kyleabaker
Visitor

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 2
TheEndless
Channel Surfer

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
Visitor

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