diff --git a/components/ListPoster.brs b/components/ListPoster.brs index 8c8a2b6a..170693c3 100644 --- a/components/ListPoster.brs +++ b/components/ListPoster.brs @@ -5,6 +5,8 @@ sub init() m.backdrop = m.top.findNode("backdrop") + m.deviceInfo = CreateObject("roDeviceInfo") + ' Randmomise the background colors posterBackgrounds = m.global.constants.poster_bg_pallet m.backdrop.color = posterBackgrounds[rnd(posterBackgrounds.count()) - 1] @@ -68,6 +70,13 @@ sub focusChanged() m.staticTitle.visible = false m.title.visible = true + ' text to speech for accessibility + if m.deviceInfo.IsAudioGuideEnabled() = true + txt2Speech = CreateObject("roTextToSpeech") + txt2Speech.Flush() + txt2Speech.Say(m.title.text) + end if + else m.title.repeatCount = 0 m.staticTitle.visible = true diff --git a/components/extras/ExtrasItem.brs b/components/extras/ExtrasItem.brs new file mode 100644 index 00000000..d94d2147 --- /dev/null +++ b/components/extras/ExtrasItem.brs @@ -0,0 +1,31 @@ +sub init() + m.posterImg = m.top.findNode("posterImg") + m.name = m.top.findNode("pLabel") + m.role = m.top.findNode("subTitle") + + m.deviceInfo = CreateObject("roDeviceInfo") +end sub + +sub showContent() + if m.top.itemContent <> invalid + cont = m.top.itemContent + m.name.text = cont.labelText + m.name.maxWidth = cont.imageWidth + m.role.Width = cont.imageWidth + m.posterImg.uri = cont.posterUrl + m.posterImg.width = cont.imageWidth + m.role.Text = cont.subTitle + else + m.role.text = tr("Unknown") + m.posterImg.uri = "pkg:/images/baseline_person_white_48dp.png" + end if +end sub + +sub focusChanged() + if m.deviceInfo.IsAudioGuideEnabled() = true + txt2Speech = CreateObject("roTextToSpeech") + txt2Speech.Flush() + txt2Speech.Say(m.name.text) + txt2Speech.Say(m.role.text) + end if +end sub diff --git a/components/extras/ExtrasItem.xml b/components/extras/ExtrasItem.xml index 26303785..d812ac1a 100644 --- a/components/extras/ExtrasItem.xml +++ b/components/extras/ExtrasItem.xml @@ -2,31 +2,9 @@ + - +