From 4fcd29d70a073dd126b7d909c54b5d67b0414c44 Mon Sep 17 00:00:00 2001 From: Hicham Boushaba Date: Mon, 20 May 2024 18:27:30 +0100 Subject: [PATCH 1/2] Improve the header's layout to work better with large fonts --- .../android/ui/dashboard/stats/DashboardStatsHeader.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/dashboard/stats/DashboardStatsHeader.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/dashboard/stats/DashboardStatsHeader.kt index a31a92c73cd..9a0b4c91285 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/dashboard/stats/DashboardStatsHeader.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/dashboard/stats/DashboardStatsHeader.kt @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.defaultMinSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.material.ContentAlpha import androidx.compose.material.DropdownMenu import androidx.compose.material.DropdownMenuItem @@ -56,12 +57,14 @@ fun DashboardStatsHeader( style = MaterialTheme.typography.body2, color = MaterialTheme.colors.onSurface ) - val isCustomRange = rangeSelection.selectionType == SelectionType.CUSTOM + val isCustomRange = rangeSelection.selectionType == SelectionType.CUSTOM Row( horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = dimen.minor_100)), verticalAlignment = Alignment.CenterVertically, modifier = Modifier + .weight(1f) + .wrapContentSize(align = Alignment.CenterStart) .then(if (isCustomRange) Modifier.clickable(onClick = onCustomRangeClick) else Modifier) .padding(dimensionResource(id = dimen.minor_100)) ) { @@ -72,7 +75,8 @@ fun DashboardStatsHeader( MaterialTheme.colors.primary } else { MaterialTheme.colors.onSurface.copy(alpha = ContentAlpha.medium) - } + }, + modifier = Modifier.weight(1f, fill = false) ) if (isCustomRange) { Icon( @@ -84,8 +88,6 @@ fun DashboardStatsHeader( } } - Spacer(modifier = Modifier.weight(1f)) - Box { var isMenuExpanded by remember { mutableStateOf(false) } IconButton( From e9a92c5cacfb7ab540e8978dc3f3defcbf39467a Mon Sep 17 00:00:00 2001 From: Hicham Boushaba Date: Mon, 20 May 2024 18:31:45 +0100 Subject: [PATCH 2/2] Add release notes entry --- RELEASE-NOTES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index cba2cb9392b..082d5b325e6 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -6,6 +6,7 @@ 18.7 ----- - [*] Products: Fixed a bug that caused the app to crash sometimes during screen rotation [https://github.com/woocommerce/woocommerce-android/pull/11484] +- [*] Dashboard: Fixed an issue that caused the date range picker to be invisible when using large fonts [https://github.com/woocommerce/woocommerce-android/pull/11552] 18.6 -----