0

There are lots of solutions for endless scrolling in recycler views, etc., but I haven't found anything that deals with endless scrolling of text. My use case is viewing an extremely long text (think several book's worth). I would like to allow smooth, bidirectional scrolling through the text without paging. The app would provide the user the ability to navigate to any particular position in the text. It would also provide visual feedback (in a separate area of the screen) of the current position in the text. The display needs to support text selection and gesture detection.

The only approach I can think of is to partition the text into relatively small chunks and use a recycler view. This seems awkward, and presents difficulties when there are long text passages that don't have natural break points (such as paragraph or chapter boundaries). I also don't know how, using this approach, I could support text selection that might happen to span boundaries between rows in the recycler view.

Can anyone recommend an alternative approach? I don't think just dynamically loading text into a TextView will work, because I would eventually want (and probably need) to unload text that's far from the current viewing point. I don't know how to do that while preserving the current scroll position.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521

1 Answers1

0

If you really want a fast and powerful option for this witch also support dynamic loading of the text just use WebView.

There are other options of course, but depending on the requirements it may take a custom view and a custom OnTouchListener.

Good luck!

Alex
  • 962
  • 4
  • 15