It's good code, for autoadjusting the label size (important that the text must be set _after_ height = -2).
But when real text height is very big (loooong multiline text) - we must limit the view height, to fit the activity interface.
After height = -2 - this value is stored and returned back, if to read the height.
How to get the real view size after such adjustment ? Actually, it's needed a sub to adjust the height, using the max limit, but if text is shorter - view's height should be smaller...
Sub Adjust_Height(v As EditText, maxlimit As Int)
Dim Calc As Int = su.MeasureMultilineTextHeight(v, v.Text)
If Calc > maxlimit Then
v.Height = maxlimit
Else
v.SetLayout(v.Left, v.Top, v.Width, -2)
End If
v.Text = v.Text
End Sub