From 8a52d2b8ce9252f909e2f4b16ab3cc24f1696928 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 31 Dec 2025 09:23:08 +0100 Subject: [PATCH] Improve preview. --- .../atomic/atoms/PlaybackSpeedButton.kt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/PlaybackSpeedButton.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/PlaybackSpeedButton.kt index bfc876d13a..66bdf6505d 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/PlaybackSpeedButton.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/PlaybackSpeedButton.kt @@ -9,6 +9,7 @@ package io.element.android.libraries.designsystem.atomic.atoms import androidx.compose.foundation.background import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.padding @@ -21,6 +22,7 @@ import io.element.android.compound.theme.ElementTheme import io.element.android.libraries.designsystem.preview.ElementPreview import io.element.android.libraries.designsystem.preview.PreviewsDayNight import io.element.android.libraries.designsystem.theme.components.Text +import io.element.android.libraries.designsystem.theme.messageFromMeBackground @Composable fun PlaybackSpeedButton( @@ -56,10 +58,17 @@ fun PlaybackSpeedButton( @PreviewsDayNight @Composable internal fun PlaybackSpeedButtonPreview() = ElementPreview { - Row { - PlaybackSpeedButton(speed = 0.5f, onClick = {}) - PlaybackSpeedButton(speed = 1.0f, onClick = {}) - PlaybackSpeedButton(speed = 1.5f, onClick = {}) - PlaybackSpeedButton(speed = 2.0f, onClick = {}) + Row( + modifier = Modifier + .background(ElementTheme.colors.messageFromMeBackground) + .padding(4.dp), + horizontalArrangement = Arrangement.spacedBy(8.dp) + ) { + listOf(0.5f, 1.0f, 1.5f, 2.0f, 3.0f).forEach { speed -> + PlaybackSpeedButton( + speed = speed, + onClick = {}, + ) + } } }