I want to get the number of lines of a text view
textView.setText(\"Test line 1 Test line 2 Test line 3 Test line 4 Test line 5.............\")
You can also calculate the amount of lines through this function:
private fun countLines(textView: TextView): Int {
return Math.ceil(textView.paint.measureText(textView.text.toString()) /
textView.measuredWidth.toDouble()).toInt()
}
Keep in mind that It may not work very well on a RecyclerView though.