Skip to content

Commit f8bacef

Browse files
author
Lars Werkman
committed
fixed one line skeleton loading
1 parent a933864 commit f8bacef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

skeletonloading-views/src/main/java/com/larswerkman/views/SkeletonTextView.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import android.graphics.Paint
55
import android.graphics.drawable.Drawable
66
import android.text.Spannable
77
import android.text.style.ReplacementSpan
8-
import android.view.Gravity
98
import android.view.View
109
import android.widget.TextView
1110
import androidx.core.text.buildSpannedString
@@ -129,6 +128,13 @@ class SkeletonTextView(
129128
end: Int,
130129
fm: Paint.FontMetricsInt?
131130
): Int {
131+
fm?.apply {
132+
top = fontMetrics.top
133+
bottom = fontMetrics.bottom
134+
ascent = fontMetrics.ascent
135+
descent = fontMetrics.descent
136+
}
137+
132138
return width
133139
}
134140

0 commit comments

Comments
 (0)