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: 
EnTerr
Roku Guru

shortDescriptionLine# length in roListScreen

How can i determine the approx. length of the text that will be displayed in ShortDescriptionLine1 and 2 - by roListScreen?

What i am trying to do is to display maximum amount of text under the poster image (on the right side, using roListScreen). The ShortDescriptionLine1 and ShortDescriptionLine2 (metadata) attributes of the selected item are shown there, each of them displays 1 or 2 lines of text (and it varies).

I have a piece of text and would like to show as much as possible of it - presumably by splitting some of it in ShortDescriptionLine1 and the rest to ShortDescriptionLine2. I don't mind the difference in fonts for both (ShortDescriptionLine1 is shown with more prominent size/weight, #2 is tad smaller). If i don't choose wisely and chunk is too long, ShortDescriptionLine1 will chew the end and replace it with "...".

I don't need exact solution, a decent approximation would do. I think this depends on how roListScreen drawing routine makes its drawing decisions.
0 Kudos
1 REPLY 1
EnTerr
Roku Guru

Re: shortDescriptionLine# length in roListScreen

<drama sigh> I had to settle on using the following unsightly function with different hand-picked len params
function cleave(s as String, ln as Integer):
'given _s_, split into 2 strings
'so that 1st string be of len <= ln

'try to split on a preceding space
for i = ln to ln - 15 step -1:
if s.mid(i, 1) = " " then ln = i: exit for
end for
return [s.left(ln), s.mid(ln)]
end function

But if someone comes with something better, let me know.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.