From f66b17782d0c0a871ed21bc6ea4349f69498ad65 Mon Sep 17 00:00:00 2001 From: Benoit Quenaudon Date: Tue, 19 Apr 2022 11:00:40 -0400 Subject: [PATCH] Fix some typos and indention --- .../ui/components/AgendaLayout.kt | 5 ++--- .../ui/components/AgendaPager.kt | 2 +- .../androidmakers/store/AndroidMakersStore.kt | 21 ++++++++++++------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/fr/paug/androidmakers/ui/components/AgendaLayout.kt b/app/src/main/java/fr/paug/androidmakers/ui/components/AgendaLayout.kt index 964d61d1..730581d7 100644 --- a/app/src/main/java/fr/paug/androidmakers/ui/components/AgendaLayout.kt +++ b/app/src/main/java/fr/paug/androidmakers/ui/components/AgendaLayout.kt @@ -33,7 +33,6 @@ import fr.paug.androidmakers.ui.viewmodel.LceViewModel import fr.paug.androidmakers.util.EmojiUtils import fr.paug.androidmakers.util.TimeUtils import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.map import java.text.DateFormat import java.util.* @@ -71,7 +70,7 @@ fun AgendaLayout( } } -class AgendLayoutViewModel: LceViewModel() { +class AgendaLayoutViewModel: LceViewModel() { override fun produce(): Flow> { return AndroidMakersApplication.instance().store.getAgenda() } @@ -82,7 +81,7 @@ private fun AgendaPagerOrLoading( sessionFilters: List, onSessionClick: (sessionId: String, roomId: String, startTimestamp: Long, endTimestamp: Long) -> Unit, ) { - ButtonRefreshableLceLayout(viewModel()){ + ButtonRefreshableLceLayout(viewModel()){ val days = agendaToDays(it) AgendaPager( diff --git a/app/src/main/java/fr/paug/androidmakers/ui/components/AgendaPager.kt b/app/src/main/java/fr/paug/androidmakers/ui/components/AgendaPager.kt index 86892fc0..e398ed40 100644 --- a/app/src/main/java/fr/paug/androidmakers/ui/components/AgendaPager.kt +++ b/app/src/main/java/fr/paug/androidmakers/ui/components/AgendaPager.kt @@ -66,7 +66,7 @@ fun AgendaPager( count = days.size, state = pagerState, ) { page -> - val viewModel = viewModel() + val viewModel = viewModel() SwipeRefreshableLceLayout(viewModel = viewModel) { val days = agendaToDays(it) val items = days[page].roomSchedules.flatMap { it.scheduleSessions } diff --git a/store/src/commonMain/kotlin/fr/androidmakers/store/AndroidMakersStore.kt b/store/src/commonMain/kotlin/fr/androidmakers/store/AndroidMakersStore.kt index e353eb25..090a5ff4 100644 --- a/store/src/commonMain/kotlin/fr/androidmakers/store/AndroidMakersStore.kt +++ b/store/src/commonMain/kotlin/fr/androidmakers/store/AndroidMakersStore.kt @@ -1,7 +1,14 @@ package fr.androidmakers.store -import fr.androidmakers.store.model.* -import kotlinx.coroutines.flow.* +import fr.androidmakers.store.model.Agenda +import fr.androidmakers.store.model.Partner +import fr.androidmakers.store.model.Room +import fr.androidmakers.store.model.ScheduleSlot +import fr.androidmakers.store.model.Session +import fr.androidmakers.store.model.Speaker +import fr.androidmakers.store.model.Venue +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.combine /** * @@ -39,11 +46,11 @@ interface AndroidMakersStore { } else { Result.success( Agenda( - sessions.getOrThrow().associateBy { it.id }, - slots.getOrThrow(), - rooms.getOrThrow().associateBy { it.id }, - speakers.getOrThrow().associateBy { it.id } - ) + sessions.getOrThrow().associateBy { it.id }, + slots.getOrThrow(), + rooms.getOrThrow().associateBy { it.id }, + speakers.getOrThrow().associateBy { it.id } + ) ) } }