Skip to content

Commit

Permalink
Update Confirmation to use the default confirmation vertical arrangem…
Browse files Browse the repository at this point in the history
…ent, which is to vertically center the contents.
  • Loading branch information
stevebower committed Jan 26, 2024
1 parent bbeab8c commit 1c4c962
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public fun Confirmation(
title: String? = null,
durationMillis: Long = DialogDefaults.ShortDurationMillis,
columnState: ScalingLazyColumnState = rememberColumnState(
ScalingLazyColumnDefaults.responsive(),
ScalingLazyColumnDefaults.responsive(
verticalArrangement = DialogDefaults.ConfirmationVerticalArrangement,
),
),
) {
// Always refer to the latest inputs with which Confirmation was recomposed.
Expand All @@ -72,7 +74,7 @@ public fun Confirmation(
) ?: durationMillis

LaunchedEffect(showDialog, a11yDurationMillis) {
if (showDialog == true) {
if (showDialog) {
delay(a11yDurationMillis)
currentOnDismissed()
}
Expand All @@ -99,7 +101,9 @@ public fun ConfirmationContent(
icon: @Composable (() -> Unit)? = null,
title: String? = null,
columnState: ScalingLazyColumnState = rememberColumnState(
ScalingLazyColumnDefaults.responsive(),
ScalingLazyColumnDefaults.responsive(
verticalArrangement = DialogDefaults.ConfirmationVerticalArrangement,
),
),
showPositionIndicator: Boolean = true,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ import com.google.android.horologist.compose.material.ResponsiveDialogContent
import com.google.android.horologist.compose.material.ToggleChip
import com.google.android.horologist.compose.material.ToggleChipToggleControl
import com.google.android.horologist.compose.tools.Device
import com.google.android.horologist.screenshots.ScreenshotTestRule
import kotlinx.coroutines.runBlocking
import org.junit.Test

class DialogTest(device: Device) : ScreenSizeTest(
device = device,
showTimeText = false,
recordMode = ScreenshotTestRule.RecordMode.Record,
) {

@Composable
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1c4c962

Please sign in to comment.