Skip to content

Commit

Permalink
perf: toast radius
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Aug 2, 2024
1 parent 3c2c544 commit 36621c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/kotlin/li/songe/gkd/util/Toast.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ private val circleOutlineProvider by lazy {
object : ViewOutlineProvider() {
override fun getOutline(view: View?, outline: Outline?) {
if (view != null && outline != null) {
// 20.sp : line height, 12.dp : top/bottom padding
outline.setRoundRect(
0,
0,
view.width,
view.height,
view.height / 2f
(12.dp.px * 2 + 20.sp.px) / 2f
)
}
}
Expand Down

0 comments on commit 36621c3

Please sign in to comment.