How do I display a list of heavily formatted text fragments in Android? -


i developing android app community forum , struggling how display conversations. 1 page consists of 30 posts, bound per api. posts contain text usual formatting (strong, underline, etc.), may contain tables, blockquotes , other blocklike elements. elements can nested, e.g., <table> block may surrounded <strong> tags. each post consists of header static layout , non-formatted text.

the approach used far rendering whole conversation html in webview. easy, since can use css , javascript customize , straightforward implement. however, method has drawbacks:

  • webviews heavy. when animated gifs or large images contained, scrolling , interaction becomes less smooth on fast phones.
  • interaction app limited; more difficult scroll specific position when view rendered; mostly, because must handled via javascript , 1 never knows render times etc.
  • buttons, long touches, link clicks etc. must handled via javascript, which, different touch events, kind of cumbersome.

now thinking of different ways handle this. options following:

  • build dynamical view hirarchy. inline tags spans in textviews, rest specific layouts. disadvantages: have large number of views on screen, hard generate hierarchy , hard to, example, have block views surrounded <strong> tags.
  • a hybrid view, gmail uses it. need lot of javascript calculate distances etc. , less flexible when layout changes during display.
  • a listview of 30 webviews. webviews heavy, may unwise well.

what best way solve this? how other, similar apps solving problem? there way make javascript stuff in webviews more reliable , stable?

i think hit nail on head building view hierarchy. create custom list item layout rows, although multiline text view trick. process html use html spanned builder. need create html.taghandler deal html tags builder doesn't support though.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -