Skip to content

Commit

Permalink
Update Confirmation layout (google#2327)
Browse files Browse the repository at this point in the history
  • Loading branch information
yschimke authored Aug 1, 2024
1 parent 04ed275 commit 1ae64ea
Show file tree
Hide file tree
Showing 33 changed files with 57 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalAccessibilityManager
Expand Down Expand Up @@ -61,7 +62,7 @@ public fun Confirmation(
durationMillis: Long = DialogDefaults.ShortDurationMillis,
columnState: ScalingLazyColumnState = rememberColumnState(
ScalingLazyColumnDefaults.responsive(
verticalArrangement = DialogDefaults.ConfirmationVerticalArrangement,
verticalArrangement = confirmationVerticalArrangement(),
additionalPaddingAtBottom = 0.dp,
),
),
Expand Down Expand Up @@ -105,7 +106,7 @@ public fun ConfirmationContent(
title: String? = null,
columnState: ScalingLazyColumnState = rememberColumnState(
ScalingLazyColumnDefaults.responsive(
verticalArrangement = DialogDefaults.ConfirmationVerticalArrangement,
verticalArrangement = confirmationVerticalArrangement(),
additionalPaddingAtBottom = 0.dp,
),
),
Expand Down Expand Up @@ -147,7 +148,7 @@ public fun Confirmation(
backgroundColor: Color = MaterialTheme.colors.background,
contentColor: Color = contentColorFor(backgroundColor),
iconColor: Color = contentColor,
verticalArrangement: Arrangement.Vertical = DialogDefaults.ConfirmationVerticalArrangement,
verticalArrangement: Arrangement.Vertical = confirmationVerticalArrangement(),
contentPadding: PaddingValues = DialogDefaults.ContentPadding,
content: @Composable ColumnScope.() -> Unit,
) {
Expand All @@ -172,3 +173,10 @@ public fun Confirmation(
content = content,
)
}

private fun confirmationVerticalArrangement() = Arrangement.spacedBy(
// NB an additional 4dp bottom padding is added after the icon
// in ResponsiveDialogContent to make the 8dp in the UX spec.
space = 4.dp,
alignment = Alignment.CenterVertically,
)
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.
Binary file modified sample/src/test/audit/Confirmations_iconand3line_device204.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sample/src/test/audit/Confirmations_iconand3line_device228.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sample/src/test/audit/Confirmations_iconand3line_device240.png
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.
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.
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 1ae64ea

Please sign in to comment.