From 1674fc01d85686daf23144bb4eb8f22c079b1e8a Mon Sep 17 00:00:00 2001 From: BoD Date: Sun, 22 Mar 2026 19:55:08 +0100 Subject: [PATCH 1/2] Wear session details UI tweaks --- .../ui/session/details/SessionDetailScreen.kt | 104 ++++++++++-------- 1 file changed, 57 insertions(+), 47 deletions(-) diff --git a/wearApp/src/main/java/fr/paug/androidmakers/wear/ui/session/details/SessionDetailScreen.kt b/wearApp/src/main/java/fr/paug/androidmakers/wear/ui/session/details/SessionDetailScreen.kt index e2de0880..57bf9180 100644 --- a/wearApp/src/main/java/fr/paug/androidmakers/wear/ui/session/details/SessionDetailScreen.kt +++ b/wearApp/src/main/java/fr/paug/androidmakers/wear/ui/session/details/SessionDetailScreen.kt @@ -110,7 +110,7 @@ private fun Session(session: UISession, onBookmarkToggle: (Boolean) -> Unit) { .padding(horizontal = 8.dp) .padding(top = 8.dp), text = session.session.title, - textAlign = TextAlign.Start, + textAlign = TextAlign.Center, style = MaterialTheme.typography.title2.copy( fontWeight = FontWeight.Bold, ), @@ -158,31 +158,36 @@ private fun SessionMetadataPills( ) { Row( verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.SpaceBetween, - modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.Center, ) { Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), ) { - Text( - text = formattedDuration, - style = MaterialTheme.typography.caption1, - color = amGreen, + Row( modifier = Modifier .background( - color = amGreenLight, + color = MaterialTheme.colors.primary, shape = RoundedCornerShape(50) ) .padding(horizontal = 10.dp, vertical = 4.dp), - ) + verticalAlignment = Alignment.CenterVertically, + ) { + if (isOngoing) { + PulsatingRedDot() + Spacer(modifier = Modifier.width(4.dp)) + } - if (isOngoing) { - PulsatingRedDot() + Text( + text = formattedDuration, + style = MaterialTheme.typography.caption1, + color = MaterialTheme.colors.onPrimary, + ) } } languageWithFlag(language)?.let { langText -> + Spacer(modifier = Modifier.width(8.dp)) Text( text = langText, style = MaterialTheme.typography.caption1, @@ -203,42 +208,48 @@ private fun SessionTimeRoomRow( startsAt: LocalDateTime, roomName: String, ) { - Row( - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.Start, + FlowRow( + horizontalArrangement = Arrangement.spacedBy(space = 6.dp, alignment = Alignment.CenterHorizontally), + verticalArrangement = Arrangement.spacedBy(6.dp), modifier = Modifier .fillMaxWidth() .padding(top = 4.dp), ) { - Icon( - imageVector = Icons.Rounded.Schedule, - contentDescription = null, - modifier = Modifier.size(14.dp), - tint = MaterialTheme.colors.onSurfaceVariant, - ) - Spacer(modifier = Modifier.width(4.dp)) - Text( - text = startsAt.time.toString(), - style = MaterialTheme.typography.caption1, - color = MaterialTheme.colors.onSurfaceVariant, - ) - Text( - text = " \u2022 ", - style = MaterialTheme.typography.caption1, - color = MaterialTheme.colors.onSurfaceVariant, - ) - Icon( - imageVector = Icons.Rounded.Place, - contentDescription = null, - modifier = Modifier.size(14.dp), - tint = MaterialTheme.colors.onSurfaceVariant, - ) - Spacer(modifier = Modifier.width(4.dp)) - Text( - text = roomName, - style = MaterialTheme.typography.caption1, - color = MaterialTheme.colors.onSurfaceVariant, - ) + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(4.dp), + ) { + Icon( + imageVector = Icons.Rounded.Schedule, + contentDescription = null, + modifier = Modifier.size(14.dp), + tint = MaterialTheme.colors.onSurfaceVariant, + ) + Text( + text = startsAt.time.toString(), + style = MaterialTheme.typography.caption1, + color = MaterialTheme.colors.onSurfaceVariant, + ) + } + + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(4.dp), + ) { + Icon( + imageVector = Icons.Rounded.Place, + contentDescription = null, + modifier = Modifier.size(14.dp), + tint = MaterialTheme.colors.onSurfaceVariant, + ) + Text( + text = roomName, + style = MaterialTheme.typography.caption1, + color = MaterialTheme.colors.onSurfaceVariant, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + } } } @@ -307,7 +318,7 @@ private fun ScalingLazyListScope.sessionDescriptionSection(description: String) .fillMaxWidth() .padding(horizontal = 8.dp), text = description, - style = MaterialTheme.typography.body2.copy( + style = MaterialTheme.typography.body1.copy( hyphens = Hyphens.Auto, lineBreak = LineBreak.Paragraph, ), @@ -347,6 +358,7 @@ private fun ScalingLazyListScope.sessionSpeakersSection( ) }, onClick = {}, + enabled = false, ) { Column { if (!speaker.company.isNullOrBlank()) { @@ -361,8 +373,6 @@ private fun ScalingLazyListScope.sessionSpeakersSection( text = bio, style = MaterialTheme.typography.body2, color = MaterialTheme.colors.onSurfaceVariant, - maxLines = 4, - overflow = TextOverflow.Ellipsis, ) } } @@ -410,7 +420,7 @@ private fun languageWithFlag(language: String): String? { "french", "français" -> "\uD83C\uDDEB\uD83C\uDDF7" else -> null } - return if (flag != null) "$language $flag" else language + return if (flag != null) flag else language } @WearPreviewDevices From 13fc1fae1d7a8e76dfbc7023afd90afe7c10ba0d Mon Sep 17 00:00:00 2001 From: BoD Date: Sun, 22 Mar 2026 20:28:42 +0100 Subject: [PATCH 2/2] Reload bookmarks when pull to refresh --- .../androidmakers/ui/agenda/AgendaViewModel.kt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/AgendaViewModel.kt b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/AgendaViewModel.kt index c4b8b860..ebfd21ee 100644 --- a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/AgendaViewModel.kt +++ b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/AgendaViewModel.kt @@ -8,9 +8,11 @@ import com.androidmakers.ui.model.Lce import com.androidmakers.ui.model.UISession import fr.androidmakers.domain.interactor.ApplyForAppClinicUseCase import fr.androidmakers.domain.interactor.GetAgendaUseCase +import fr.androidmakers.domain.interactor.MergeBookmarksUseCase import fr.androidmakers.domain.interactor.SetSessionBookmarkUseCase import fr.androidmakers.domain.model.Room import fr.androidmakers.domain.repo.BookmarksRepository +import fr.androidmakers.domain.repo.UserRepository import fr.androidmakers.domain.utils.UrlOpener import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow @@ -18,18 +20,29 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.emitAll +import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch class AgendaViewModel( getAgendaUseCase: GetAgendaUseCase, + mergeBookmarksUseCase: MergeBookmarksUseCase, private val setSessionBookmarkUseCase: SetSessionBookmarkUseCase, bookmarksRepository: BookmarksRepository, + userRepository: UserRepository, private val applyForAppClinicUseCase: ApplyForAppClinicUseCase, ) : LceViewModel( produce = { refresh -> getAgendaUseCase(refresh) - .combine(bookmarksRepository.favoriteSessions) { agendaResult, favoriteSessions -> + .combine( + flow { + userRepository.currentUser?.let { + mergeBookmarksUseCase(it.id) + } + emitAll(bookmarksRepository.favoriteSessions) + } + ) { agendaResult, favoriteSessions -> agendaResult.map { agenda -> AgendaState( days = agendaToDays(agenda, favoriteSessions),