mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-28 14:08:44 +03:00
Shorter code here because I'm looking at it
Change-Id: I444d0fa28fc92f996d58c16f65d9bebbd065ef69
This commit is contained in:
parent
2995375586
commit
3a47c1b438
1 changed files with 2 additions and 3 deletions
|
@ -9,6 +9,7 @@ import android.text.Layout
|
|||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import kotlin.math.ceil
|
||||
import kotlin.math.max
|
||||
|
||||
class WrapWidthTextView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
|
@ -28,9 +29,7 @@ class WrapWidthTextView @JvmOverloads constructor(
|
|||
var maxWidth = 0.0f
|
||||
val lines = layout.lineCount
|
||||
for (i in 0 until lines) {
|
||||
if (layout.getLineWidth(i) > maxWidth) {
|
||||
maxWidth = layout.getLineWidth(i)
|
||||
}
|
||||
maxWidth = max(maxWidth, layout.getLineWidth(i))
|
||||
}
|
||||
return maxWidth
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue