Of course, you also have this in Android.
The property is called "Ellipsize" and you have several options.
In XML:
android:ellipsize="start|marquee|end"
Or through the code
textView.setEllipsize(TruncateAt.START | TruncateAt.END | TruncateAt.MARQUEE);
Values:
- Start . Puts a "..." at the beginning of the text.
- End : puts "..." at the end
- Marquee : Does the scroll pane have
NOTES: Single Line
TextView should be a single line, so for this to work, also do this (or their equivalent XML properties maxLines and singleLine ):
textView.setSingleLine(true);
or
textView.setMaxLines(1);
Notes: Marquee Mode
For Marquee to work, TextView must have focus (the marquee will begin to move as soon as you click on the text image). You can also force the scroll of the selected area:
textView.setFocusable(true); textView.requestFocus();
source share