|
|
@ -8,13 +8,8 @@ import androidx.appcompat.widget.AppCompatTextView |
|
|
|
class MultilineTextView(context: Context?, attrs: AttributeSet?) : |
|
|
|
class MultilineTextView(context: Context?, attrs: AttributeSet?) : |
|
|
|
AppCompatTextView(context, attrs) { |
|
|
|
AppCompatTextView(context, attrs) { |
|
|
|
|
|
|
|
|
|
|
|
private var calculatedLines = false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onDraw(canvas: Canvas?) { |
|
|
|
override fun onDraw(canvas: Canvas?) { |
|
|
|
if (!calculatedLines) { |
|
|
|
calculateLines() |
|
|
|
calculateLines(); |
|
|
|
|
|
|
|
calculatedLines = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
super.onDraw(canvas) |
|
|
|
super.onDraw(canvas) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|