8

I want to replace the char ('...') with a string ("...Read more"). Any easy way to do that by extending TextView and overriding a property? I am expanding the TextView on click by increasing lines from 2 to 500 and vice versa. The TextView is in a ScrollView.

loshkin
  • 1,600
  • 2
  • 21
  • 38
  • Are you ellipsizing your textview? And you want to replace or override that ellipsized string on the end as "..."? – Hassan Jamil Dec 02 '16 at 10:10
  • Yes, I am ellipsizing it. And it is all correct. The problem is that I want to add "Read more" after the ellipsizing or to be part of it. – loshkin Dec 02 '16 at 10:17
  • Checkout the answer, I think it is all what you need http://stackoverflow.com/a/19676336/3819836 – Hassan Jamil Dec 02 '16 at 10:21
  • If I was going for an overcomplicated solution, I would implement my own custom view. The thing is that I really think there might be a simple solution that doesn't involve Layout observers, clickable spannables,...etc. @HassanJamil – loshkin Dec 02 '16 at 11:09
  • Yeah, it is overcomplicated as per your requirements, I think you will not find any other simpler solution than this http://stackoverflow.com/a/18738234/3819836 – Hassan Jamil Dec 02 '16 at 11:49

0 Answers0