0

What Android component can be added to a set of view (TextView and Button) to simulate the behavior of a text?

Here is one example in picture of what I expected:

Capture

StarsSky
  • 6,721
  • 6
  • 38
  • 63
lopez.mikhael
  • 9,943
  • 19
  • 67
  • 110

2 Answers2

0

You can have a webView and load it using HTML tags (define a string with the content and then call loadData() webView method or you can create a Layout with some TextViews and custom Buttons

Renan Bandeira
  • 3,238
  • 17
  • 27
0

One solution could be that you define your own tag let's say < clickable>. Then if we say that text is:

Hello, this is my < clickable> clickable < /clickable> text. 

Then we extend TextView and override onDraw method where we draw the text ourselves and needed backgrounds for text's which have the clickable tag set. After that implement the onClickListener which calculates if clickable text part was clicked.

Not an easy solution, but when implemented, usage is easy and handy allowing all kinds of other requirements implemented as well.

Here is also some help: How to set the part of the text view is clickable

Community
  • 1
  • 1
Niko
  • 8,093
  • 5
  • 49
  • 85
  • I think you got solution works, however it is particularly complex and expensive especially if I want to dynamically change content for example. I think there is a better solution out of the webview, at least I hope ^^. – lopez.mikhael Jan 06 '14 at 16:25