@@ -4,9 +4,9 @@ import kotlin.time.Duration
44import org.cobalt.ui.UIComponent
55import org.cobalt.ui.animation.BounceAnimation
66import org.cobalt.ui.animation.EaseOutAnimation
7- import org.cobalt.util.WindowUtils.windowWidth
8- import org.cobalt.util.skia.Skia
9- import org.cobalt.util.skia.helper .SkiaCorner
7+ import org.cobalt.util.client. WindowUtils.windowWidth
8+ import org.cobalt.util.render.SkiaRenderer
9+ import org.cobalt.util.render. skia.data .SkiaCorner
1010
1111class Notification (
1212 private val title : String ,
@@ -60,7 +60,7 @@ class Notification(
6060 val resolvedY = targetY + slideDownAnim.get(previousY - targetY, 0f , false )
6161 updateBounds(resolvedX, resolvedY)
6262
63- Skia .roundedRect(
63+ SkiaRenderer .roundedRect(
6464 xPos, yPos, width, height,
6565 CORNER_RADIUS , theme.backgroundPrimary
6666 )
@@ -74,17 +74,17 @@ class Notification(
7474 val hasDescription = description.isNotBlank()
7575 val titleFontSize = if (hasDescription) TITLE_FONT_SIZE else TITLE_FONT_SIZE_ALONE
7676
77- val titleHeight = Skia .wrappedTextHeight(Skia .boldFont, title, contentWidth, titleFontSize)
77+ val titleHeight = SkiaRenderer .wrappedTextHeight(SkiaRenderer .boldFont, title, contentWidth, titleFontSize)
7878
79- Skia .wrappedText(
80- Skia .boldFont, title,
79+ SkiaRenderer .wrappedText(
80+ SkiaRenderer .boldFont, title,
8181 xPos + CONTENT_PADDING , yPos + CONTENT_PADDING ,
8282 contentWidth, titleFontSize, theme.textPrimary,
8383 )
8484
8585 if (hasDescription) {
86- Skia .wrappedText(
87- Skia .boldFont, description,
86+ SkiaRenderer .wrappedText(
87+ SkiaRenderer .boldFont, description,
8888 xPos + CONTENT_PADDING , yPos + CONTENT_PADDING + titleHeight + TITLE_DESCRIPTION_GAP ,
8989 contentWidth, DESCRIPTION_FONT_SIZE , theme.textSecondary,
9090 )
@@ -95,7 +95,7 @@ class Notification(
9595 val progress = calculateProgress(System .currentTimeMillis())
9696 val fillWidth = width * progress
9797
98- Skia .roundedRect(
98+ SkiaRenderer .roundedRect(
9999 xPos, yPos + height - PROGRESS_BAR_HEIGHT ,
100100 width, PROGRESS_BAR_HEIGHT ,
101101 CORNER_RADIUS ,
@@ -104,7 +104,7 @@ class Notification(
104104 )
105105
106106 if (fillWidth > 0f ) {
107- Skia .roundedRect(
107+ SkiaRenderer .roundedRect(
108108 xPos, yPos + height - PROGRESS_BAR_HEIGHT ,
109109 fillWidth, PROGRESS_BAR_HEIGHT ,
110110 CORNER_RADIUS ,
@@ -146,17 +146,17 @@ class Notification(
146146 private fun calculateHeight (title : String , description : String ): Float {
147147 val titleFontSize = if (description.isNotBlank()) TITLE_FONT_SIZE else TITLE_FONT_SIZE_ALONE
148148
149- val titleHeight = Skia .wrappedTextHeight(
150- Skia .boldFont, title,
149+ val titleHeight = SkiaRenderer .wrappedTextHeight(
150+ SkiaRenderer .boldFont, title,
151151 DEFAULT_WIDTH - CONTENT_PADDING * 2 ,
152152 titleFontSize
153153 )
154154
155155 var descHeight = 0f
156156
157157 if (description.isNotBlank()) {
158- descHeight = Skia .wrappedTextHeight(
159- Skia .boldFont, description,
158+ descHeight = SkiaRenderer .wrappedTextHeight(
159+ SkiaRenderer .boldFont, description,
160160 DEFAULT_WIDTH - CONTENT_PADDING * 2 ,
161161 DESCRIPTION_FONT_SIZE
162162 )
0 commit comments