The attached image shows the desired end result of how you would like to submit a series of items that are part of a CustomListView.
Each item consists of 3 labels: the first is normal, the second is with bold font and the third contains a text very very long.
I would like this text to be truncated to the third row and to the right point (between 2 words, or at a punctuation mark) and was followed by three or four dots blacks ("....")
Photoshopped image is in the red because I wanted to highlight the salient point of this problem.
I made some attempt that uses the Canvas
but it is very slow (the items can also be numerous, 200-300) and in any case takes into account only the first line of the 3 that make up the label No. 3
I also tried with
Thanks, however, the result of SetMaxLines is strange.
In the first image I set SetMaxLines 2 and the third row disappears.
In the second image I set SetMaxLines to 3, and the third line appears but the dots are on the second !!!
Despite numerous attempts have never been able to put the dots on the third line.
Thanks again but what is wrong?
The code is
B4X:
Sub SetEllipsize(TextView As Label, Mode As String)
Dim r As Reflector
r.Target = TextView
'r.RunMethod2("setLines", 3, "java.lang.int")
r.RunMethod2("setMaxLines",3,"java.lang.int") ' or 2
'r.RunMethod2("setSingleLine", False, "java.lang.boolean")
'r.RunMethod2("setHorizontallyScrolling", False, "java.lang.boolean")
r.RunMethod2("setEllipsize", Mode, "android.text.TextUtils$TruncateAt")
End Sub