Skip to content

Commit

Permalink
Fix working hours alignment on expandable section (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriisurzhykov authored May 31, 2024
2 parents d981533 + c598861 commit 4796f04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,15 +16,17 @@ 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(
time.startTime.toFormattedString(),
time.endTime.toFormattedString()
),
modifier = modifier,
style = style
style = style,
textAlign = textAlign
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
}
Expand Down

0 comments on commit 4796f04

Please sign in to comment.