Skip to content

Commit

Permalink
Dialog 2: Dialog Harder (#2343)
Browse files Browse the repository at this point in the history
* Update dialogs following validation.

Top & bottom padding to be percent based (14.56% and 20.83% respectively).
Add 4.dp extra below the Title if there is no message.

Bug: http://b/352552040

* 🤖 reformat

* 🤖 metalava

* 🤖 Updates screenshots

---------

Co-authored-by: ssancho14 <ssancho14@users.noreply.github.com>
Co-authored-by: Yuri Schimke <yuri@schimke.ee>
  • Loading branch information
3 people authored Aug 13, 2024
1 parent 901934a commit 6c92d68
Show file tree
Hide file tree
Showing 144 changed files with 241 additions and 238 deletions.
1 change: 1 addition & 0 deletions compose-layout/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ package com.google.android.horologist.compose.layout {
enum_constant public static final com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType Card;
enum_constant public static final com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType Chip;
enum_constant public static final com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType CompactChip;
enum_constant public static final com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType Dialog;
enum_constant public static final com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType Icon;
enum_constant public static final com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType MultiButton;
enum_constant public static final com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType SingleButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ public object ScalingLazyColumnDefaults {
}

internal val Padding12Pct = 0.1248f
internal val Padding14Pct = 0.1456f
internal val Padding16Pct = 0.1664f
internal val Padding20Pct = 0.2083f
internal val Padding21Pct = 0.2188f
Expand All @@ -242,6 +243,7 @@ public object ScalingLazyColumnDefaults {
SingleButton(Padding12Pct, Padding20Pct),
Text(Padding16Pct, Padding31Pct),
BodyText(Padding21Pct, Padding31Pct),
Dialog(Padding14Pct, Padding20Pct),
Unspecified(0f, 0f),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ import androidx.wear.compose.material.MaterialTheme
import com.google.android.horologist.annotations.ExperimentalHorologistApi
import com.google.android.horologist.compose.layout.ScalingLazyColumn
import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults
import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.responsive
import com.google.android.horologist.compose.layout.ScalingLazyColumnState
import com.google.android.horologist.compose.layout.ScreenScaffold
import com.google.android.horologist.compose.layout.rememberColumnState
import com.google.android.horologist.compose.layout.rememberResponsiveColumnState
import com.google.android.horologist.images.base.paintable.ImageVectorPaintable

@ExperimentalHorologistApi
Expand All @@ -68,11 +68,11 @@ public fun ResponsiveDialogContent(
onCancel: (() -> Unit)? = null,
okButtonContentDescription: String = stringResource(android.R.string.ok),
cancelButtonContentDescription: String = stringResource(android.R.string.cancel),
@Suppress("DEPRECATION") state: ScalingLazyColumnState =
rememberColumnState(
responsive(
firstItemIsFullWidth = icon == null,
additionalPaddingAtBottom = 0.dp,
state: ScalingLazyColumnState =
rememberResponsiveColumnState(
contentPadding = ScalingLazyColumnDefaults.padding(
first = ScalingLazyColumnDefaults.ItemType.Dialog,
last = ScalingLazyColumnDefaults.ItemType.Dialog,
),
),
showPositionIndicator: Boolean = true,
Expand Down Expand Up @@ -113,7 +113,7 @@ public fun ResponsiveDialogContent(
Box(
Modifier
.fillMaxWidth(titleMaxWidthFraction)
.padding(bottom = 8.dp), // 12.dp below icon
.padding(bottom = if (message == null) 12.dp else 8.dp), // 16.dp or 12.dp below title
) { it() }
}
}
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.
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.
Binary file modified sample/src/test/audit/Confirmations_iconand3line_pixel_watch.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/Dialogs_onebottombutton_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/Dialogs_onebottombutton_pixel_watch.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/Dialogs_onebuttonchip_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/Dialogs_onebuttonchip_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/Dialogs_onebuttonchip_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.
Binary file modified sample/src/test/audit/Dialogs_onebuttonchip_pixel_watch.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.
Binary file modified sample/src/test/audit/Dialogs_twobottombuttons_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/Dialogs_twobottombuttons_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/Dialogs_twobottombuttons_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.
Binary file modified sample/src/test/audit/Dialogs_twobottombuttons_pixel_watch.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

0 comments on commit 6c92d68

Please sign in to comment.