android - Custom rendering for text with special syntax -
i have text gathered api , consists of custom syntax. display using textview need render special part of text , convert text elements. example of text below.
oh, that's great idea! check (user: someuser)'s answer this. can @ (ref: forum post title) or: (ref: forum post) hint you! (hint: should displayed mini icon when clicked, tooltip should opened) here spoiler you. ---- spoiler ---- spoiler. text should not displayed directly should converted button element. when button clicked, text should shown ---- spoiler ----
so, need convert (user: someuser)
link in view shown "someuser" when clicked, open new intent. (ref: topic)
keyword, it's same. when hit spoiler
, want make nice button indicating it's spoiler , when user clicks, expand.
how can parse text , show correctly in view? don't have problem parsing problem displaying elements in view.
methods tried
i tried webview instead of textview thinking can convert html/js performance terrible. although use recycleview , viewholder, webview overkill. need use kind of textview elements have.
i looked @ custom html tag handling textview (thinking can convert legacy tags html) failed see how can insert button spoiler tag or insert custom elements tooltip hint.
thank you!
Comments
Post a Comment