Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf7d502

Browse files
Apply changes from ktLintFormat
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent1a5bdeb commitdf7d502

File tree

3 files changed

+38
-25
lines changed

3 files changed

+38
-25
lines changed

‎samples/containers/thingy/src/main/java/com/squareup/sample/thingy/BackStackWorkflowImpl.kt‎

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ private class BackStackWorkflowScopeImpl<PropsT, OutputT, R>(
162162
overridesuspendfungoBack():Nothing {
163163
// If parent is null, goBack will not be exposed and will never be called.
164164
val parent= checkNotNull(parentFrame) {"goBack called on root scope" }
165-
actionSink.send(action("popTo") {
166-
state= state.popToFrame(parent)
167-
})
165+
actionSink.send(
166+
action("popTo") {
167+
state= state.popToFrame(parent)
168+
}
169+
)
168170
thisFrame.cancelSelf()
169171
}
170172
}
@@ -205,9 +207,11 @@ private class BackStackScreenScopeImpl<PropsT, OutputT, R>(
205207
overridefungoBack() {
206208
// If parent is null, goBack will not be exposed and will never be called.
207209
val parent= checkNotNull(parentFrame) {"goBack called on root scope" }
208-
actionSink.send(action("popTo") {
209-
state= state.popToFrame(parent)
210-
})
210+
actionSink.send(
211+
action("popTo") {
212+
state= state.popToFrame(parent)
213+
}
214+
)
211215
thisFrame.cancel()
212216
}
213217
}
@@ -407,9 +411,11 @@ private suspend fun <PropsT, OutputT, ChildPropsT, ChildOutputT, R> showWorkflow
407411
}else {
408412
// Ensure the frame has actually been added to the stack.
409413
readyForPropUpdates.join()
410-
actionSink.send(action("setProps") {
411-
state= state.setFrameProps(frame, newProps)
412-
})
414+
actionSink.send(
415+
action("setProps") {
416+
state= state.setFrameProps(frame, newProps)
417+
}
418+
)
413419
}
414420
}
415421
}
@@ -424,9 +430,11 @@ private suspend fun <PropsT, OutputT, ChildPropsT, ChildOutputT, R> showWorkflow
424430
)
425431

426432
// Tell the workflow runtime to start rendering the new workflow.
427-
actionSink.send(action("showWorkflow") {
428-
state= state.appendFrame(frame)
429-
})
433+
actionSink.send(
434+
action("showWorkflow") {
435+
state= state.appendFrame(frame)
436+
}
437+
)
430438
// Allow the props collector to send more prop update actions. Even though the initial action
431439
// hasn't run yet, any future actions will be enqueued after it, so it's safe.
432440
readyForPropUpdates.complete()
@@ -435,9 +443,11 @@ private suspend fun <PropsT, OutputT, ChildPropsT, ChildOutputT, R> showWorkflow
435443
frame.awaitResult()
436444
}finally {
437445
frameScope.cancel()
438-
actionSink.send(action("unshowWorkflow") {
439-
state= state.removeFrame(frame)
440-
})
446+
actionSink.send(
447+
action("unshowWorkflow") {
448+
state= state.removeFrame(frame)
449+
}
450+
)
441451
}
442452
}
443453

@@ -459,17 +469,21 @@ private suspend fun <OutputT, R> showScreenImpl(
459469
frame.initScreen(screenFactory)
460470

461471
// Tell the workflow runtime to start rendering the new workflow.
462-
actionSink.send(action("showScreen") {
463-
state= state.appendFrame(frame)
464-
})
472+
actionSink.send(
473+
action("showScreen") {
474+
state= state.appendFrame(frame)
475+
}
476+
)
465477

466478
returntry {
467479
frame.awaitResult()
468480
}finally {
469481
frameScope.cancel()
470-
actionSink.send(action("unshowScreen") {
471-
state= state.removeFrame(frame)
472-
})
482+
actionSink.send(
483+
action("unshowScreen") {
484+
state= state.removeFrame(frame)
485+
}
486+
)
473487
}
474488
}
475489

‎samples/containers/thingy/src/main/java/com/squareup/sample/thingy/MyWorkflow.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class MyWorkflow(
3939
"next"-> {
4040
// Step 2
4141
val childResult= showWorkflow(child2) { output->
42-
// Removes child2 from the stack, cancels the output handler from step 1, and just
43-
// leaves child1 rendering.
42+
// Removes child2 from the stack, cancels the output handler from step 1, and just
43+
// leaves child1 rendering.
4444
if (output=="back") goBack()
4545
output
4646
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
packagecom.squareup.workflow1.ui.navigation
22

3-
publicclassThingy :Stateful {
4-
}
3+
publicclassThingy :Stateful

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp