feat: 优化代码

pull/141/head
kunfei 5 years ago
parent 6576fa475f
commit 9e5e493892
  1. 7
      app/src/main/java/io/legado/app/ui/widget/text/MultilineTextView.kt

@ -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)
} }

Loading…
Cancel
Save