Skip to content

Commit 899c7d7

Browse files
committed
refactor: Rename onConfirm -> onBackWithConfirm
1 parent e9e04d2 commit 899c7d7

3 files changed

Lines changed: 18 additions & 11 deletions

File tree

  • app-android/src/main/java/io/github/droidkaigi/confsched
  • app-ios-shared/src/commonMain/kotlin/io/github/droidkaigi/confsched/shared
  • feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard

app-android/src/main/java/io/github/droidkaigi/confsched/KaigiApp.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private fun KaigiNavHost(
194194

195195
cropImageScreens(
196196
onNavigationIconClick = navController::popBackStack,
197-
onConfirm = navController::popBackStack,
197+
onBackWithConfirm = navController::popBackStack,
198198
)
199199
}
200200
}

app-ios-shared/src/commonMain/kotlin/io/github/droidkaigi/confsched/shared/IosComposeKaigiApp.kt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ fun kaigiAppController(
120120
) {
121121
val windowSizeClass = calculateWindowSizeClass()
122122

123-
val settingsRepository = LocalRepositories.current[SettingsRepository::class] as SettingsRepository
123+
val settingsRepository =
124+
LocalRepositories.current[SettingsRepository::class] as SettingsRepository
124125
val fontFamily = when (val settings = settingsRepository.settings()) {
125126
DoesNotExists, Loading -> dotGothic16FontFamily()
126127
is Exists -> {
@@ -256,7 +257,7 @@ private fun KaigiNavHost(
256257

257258
cropImageScreens(
258259
onNavigationIconClick = navController::popBackStack,
259-
onConfirm = navController::popBackStack,
260+
onBackWithConfirm = navController::popBackStack,
260261
)
261262
}
262263
}
@@ -420,9 +421,12 @@ class ExternalNavController(
420421
val event = EKEvent.eventWithEventStore(eventStore).apply {
421422
// NSDate.dateWithTimeIntervalSince1970 receives the time in seconds.
422423
// Therefore, milliseconds are converted to seconds.
423-
startDate = NSDate.dateWithTimeIntervalSince1970(timetableItem.startsAt.toEpochMilliseconds() / 1000.0)
424-
endDate = NSDate.dateWithTimeIntervalSince1970(timetableItem.endsAt.toEpochMilliseconds() / 1000.0)
425-
title = "[${timetableItem.room.name.currentLangTitle}] ${timetableItem.title.currentLangTitle}"
424+
startDate =
425+
NSDate.dateWithTimeIntervalSince1970(timetableItem.startsAt.toEpochMilliseconds() / 1000.0)
426+
endDate =
427+
NSDate.dateWithTimeIntervalSince1970(timetableItem.endsAt.toEpochMilliseconds() / 1000.0)
428+
title =
429+
"[${timetableItem.room.name.currentLangTitle}] ${timetableItem.title.currentLangTitle}"
426430
notes = timetableItem.url
427431
location = timetableItem.room.name.currentLangTitle
428432
calendar = eventStore.defaultCalendarForNewEvents
@@ -438,7 +442,10 @@ class ExternalNavController(
438442
this.event = event
439443
this.eventStore = eventStore
440444
this.editViewDelegate = object : NSObject(), EKEventEditViewDelegateProtocol {
441-
override fun eventEditViewController(controller: EKEventEditViewController, didCompleteWithAction: EKEventEditViewAction) {
445+
override fun eventEditViewController(
446+
controller: EKEventEditViewController,
447+
didCompleteWithAction: EKEventEditViewAction,
448+
) {
442449
// Process to return to the application after pressing cancel or add in the calendar application.
443450
controller.dismissViewControllerAnimated(true, null)
444451
}

feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/CropImageScreen.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ const val cropImageScreenRoute = "cropImage"
5252

5353
fun NavGraphBuilder.cropImageScreens(
5454
onNavigationIconClick: () -> Unit,
55-
onConfirm: () -> Unit,
55+
onBackWithConfirm: () -> Unit,
5656
) {
5757
composable(
5858
cropImageScreenRoute,
5959
) {
6060
CropImageScreen(
6161
onNavigationIconClick = dropUnlessResumed(block = onNavigationIconClick),
62-
onConfirm = onConfirm,
62+
onBackWithConfirm = onBackWithConfirm,
6363
)
6464
}
6565
}
@@ -82,14 +82,14 @@ internal sealed interface CropImageScreenState {
8282
@Composable
8383
internal fun CropImageScreen(
8484
onNavigationIconClick: () -> Unit,
85-
onConfirm: () -> Unit,
85+
onBackWithConfirm: () -> Unit,
8686
modifier: Modifier = Modifier,
8787
eventFlow: EventFlow<CropImageScreenEvent> = rememberEventFlow(),
8888
uiState: CropImageScreenState = cropImageScreenPresenter(eventFlow),
8989
) {
9090
LaunchedEffect(uiState is CropImageScreenState.Confirm && uiState.shouldBack) {
9191
if (uiState is CropImageScreenState.Confirm && uiState.shouldBack) {
92-
onConfirm()
92+
onBackWithConfirm()
9393
}
9494
}
9595

0 commit comments

Comments
 (0)