dynamic - Displaying emoticons in Android -
my im app has support emoticons. gifs , have textual representations, used in input box if user selects 1 of them. i'd display them images after have been sent.currently custom array adapter displays sent message in textview of row.
what proper method display images dynamically based on occurrence of textual representation? have search emoticon texts, , if 1 found, remove textview layout (relativelayout fits most?) , add textview beginning of im, imageview emoticon , textview. if more emoticons sent simultaneously can messy.
is there easier , more logical way?
i try using regular expression replace occurrences of each emoticon <img>
tag. then, convert html spannedstring
via html.fromhtml()
. spannedstring
can used in settext()
call on textview
.
Comments
Post a Comment