We set isTruncatingText to true in this if block because we truncate the characters and reset text. The function tv.setText(newText) here will directly invoke onTextChanged() and afterTextChanged() again. But maybe I should return here to make it more clear.