I’m creating an application which shows the text in TextView. Since the text might be very large it is nested in ScrollView.
Everything works fine until the text is really large - for example the content of the whole book. For such large content the application’s UI starts to be unresponsive because of the big memory requirements.
Solution 1 Simply split the book’s content and show it in multiple pages, e.g. by using ViewPager2.
Yes, this would definitely work. However the “infinite” vertical scrolling of the text is in my situation the UI design decision, therefore this solution is not an option for me.
Solution 2 Use RecyclerView and render each line of the “book” as separate TextView instance.
This would be great solution, but unfortunately I need to support text selection. This solution would prevent the user to select multiline text.
Question Could you suggest any solution which would allow “infinite“ (RecyclerView-like) scrolling of the text while preserving all the text selection and text formatting capabilities?