When I try to set TextView's left
and right
property, the ellipsize property doesn't work. It just clips the object.
I am setting the left and right like this:
textView.left = textMargin
textView.right = Math.min(view.measuredWidth - textMargin, margin)
It has already applied ellipsize property. But, it doesn't work.
I can see the bounds are clipped:
UPDATE: It's a toolbar's default title textview. I am accessing it with reflection.
val field = Toolbar::class.java.getDeclaredField("mTitleTextView")
field.isAccessible = true
val textView: TextView? = field.get(toolbar) as TextView?