I have a ScrollView that contains a complex LinearLayout with various elements, among which there are several TextView with maxHeight defined and a long text inside. I need to enable scrolling the text inside the TextView when touch-and-dragging inside it, and the normal scroll of the ScrollView when touch-and-drag outside of them.
Is there a proper and elegant way to do this – if at all possible – or do I have to get dirty and start overriding the onTouchEvent handlers on all elements involved?
UPD 1: Judging from this there is no elegant solution, and the UI will have to be rethinked to include only one layer of scrollable elements.
So it’s not pretty, but you can extend from TextView and block the scrollview from scrolling. It’s not as nice unless your textviews are large enough. After using this solution we found that it is best if you have a “show more” label that the users can click to show the full thing. Anyway, extend from TextView and override the onTouchEvent method: