Skip to content

Commit d103fd9

Browse files
[Live Update] Fix: Correct color range for Color.valueOf (#316)
* Change rgb value due to this arguments requires 0to1 float value * Update samples/user-interface/live-updates/src/main/java/com/example/platform/ui/live_updates/SnackbarNotificationManager.kt Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update samples/user-interface/live-updates/src/main/java/com/example/platform/ui/live_updates/SnackbarNotificationManager.kt Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: Kazuki Chigita <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent edb9459 commit d103fd9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

samples/user-interface/live-updates/src/main/java/com/example/platform/ui/live_updates/SnackbarNotificationManager.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,18 @@ object SnackbarNotificationManager {
142142

143143
@RequiresApi(Build.VERSION_CODES.BAKLAVA)
144144
fun buildBaseProgressStyle(orderState: OrderState): ProgressStyle {
145-
val pointColor = Color.valueOf(236f, 183f, 255f, 1f).toArgb()
146-
val segmentColor = Color.valueOf(134f, 247f, 250f, 1f).toArgb()
145+
val pointColor = Color.valueOf(
146+
236f / 255f, // Normalize red value to be between 0.0 and 1.0
147+
183f / 255f, // Normalize green value to be between 0.0 and 1.0
148+
255f / 255f, // Normalize blue value to be between 0.0 and 1.0
149+
1f,
150+
).toArgb()
151+
val segmentColor = Color.valueOf(
152+
134f / 255f, // Normalize red value to be between 0.0 and 1.0
153+
247f / 255f, // Normalize green value to be between 0.0 and 1.0
154+
250f / 255f, // Normalize blue value to be between 0.0 and 1.0
155+
1f,
156+
).toArgb()
147157
var progressStyle = NotificationCompat.ProgressStyle()
148158
.setProgressPoints(
149159
listOf(

0 commit comments

Comments
 (0)