From c5988618a546d58a847db5222ba7338dd9ef935a Mon Sep 17 00:00:00 2001 From: Yurii Surzhykov Date: Fri, 31 May 2024 11:10:12 -0700 Subject: [PATCH] Fix working hours alignment on expandable section Signed-off-by: Yurii Surzhykov --- .../purs/location/details/LocalTimeTextView.kt | 7 +++++-- .../purs/location/details/LocationDetailsScreen.kt | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ui-features/location-details/src/main/java/com/github/yuriisurzhykov/purs/location/details/LocalTimeTextView.kt b/ui-features/location-details/src/main/java/com/github/yuriisurzhykov/purs/location/details/LocalTimeTextView.kt index a9b2a74..613e375 100644 --- a/ui-features/location-details/src/main/java/com/github/yuriisurzhykov/purs/location/details/LocalTimeTextView.kt +++ b/ui-features/location-details/src/main/java/com/github/yuriisurzhykov/purs/location/details/LocalTimeTextView.kt @@ -6,6 +6,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.style.TextAlign import com.github.yuriisurzhykov.purs.domain.model.TimeSlot import java.time.LocalTime import java.time.format.DateTimeFormatter @@ -15,7 +16,8 @@ import java.util.Locale fun LocalTimeTextView( time: TimeSlot, modifier: Modifier = Modifier, - style: TextStyle = MaterialTheme.typography.bodyLarge + style: TextStyle = MaterialTheme.typography.bodyLarge, + textAlign: TextAlign? = null ) { Text( text = stringResource(id = R.string.format_patter_time).format( @@ -23,7 +25,8 @@ fun LocalTimeTextView( time.endTime.toFormattedString() ), modifier = modifier, - style = style + style = style, + textAlign = textAlign ) } diff --git a/ui-features/location-details/src/main/java/com/github/yuriisurzhykov/purs/location/details/LocationDetailsScreen.kt b/ui-features/location-details/src/main/java/com/github/yuriisurzhykov/purs/location/details/LocationDetailsScreen.kt index edf4556..1468067 100644 --- a/ui-features/location-details/src/main/java/com/github/yuriisurzhykov/purs/location/details/LocationDetailsScreen.kt +++ b/ui-features/location-details/src/main/java/com/github/yuriisurzhykov/purs/location/details/LocationDetailsScreen.kt @@ -385,7 +385,9 @@ fun WorkingHourView(workingDay: WorkingDay) { workingDay.scheduleList.forEach { timeSlot -> LocalTimeTextView( timeSlot, - style = MaterialTheme.typography.bodyLarge.copy(fontWeight = textWeight) + style = MaterialTheme.typography.bodyLarge.copy(fontWeight = textWeight), + modifier = Modifier.fillMaxWidth(), + textAlign = TextAlign.End ) } }