Thursday, 26 September 2013

Android - Appending text lines. Help choose the right control

Android - Appending text lines. Help choose the right control

Folks,
In my social networking application, single-line messages come from
various users. As the message comes in, I need to display them in our UI
as a single line that shows the time, the user, and the message line. All
3 fields need to be colored differently.
I tried to use TextView but am running into a problem. As I need various
colors, I thought of using SpannableString but the problem is that
TextView.Append does not support SpannableString as a parameter.
The other thought I had was to build html style text as each line comes in.
I am wondering if I am overlooking something. Perhaps there is a better
user control or a better way to achieve my objective.
Thank you in advance for your help.
Regards,
Peter

No comments:

Post a Comment