Skip to content

Commit c5446a9

Browse files
committed
Renames in wake of introduction of ModalOverlay.
1 parent 6221e49 commit c5446a9

File tree

21 files changed

+120
-114
lines changed

21 files changed

+120
-114
lines changed

benchmarks/performance-poetry/complex-poetry/src/main/java/com/squareup/benchmarks/performance/complex/poetry/views/MayBeLoadingScreen.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ package com.squareup.benchmarks.performance.complex.poetry.views
33
import com.squareup.sample.container.overviewdetail.OverviewDetailScreen
44
import com.squareup.sample.container.panel.ScrimScreen
55
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
6-
import com.squareup.workflow1.ui.container.BodyAndModalsScreen
7-
import com.squareup.workflow1.ui.container.ModalScreenOverlay
6+
import com.squareup.workflow1.ui.container.BodyAndOverlaysScreen
7+
import com.squareup.workflow1.ui.container.FullScreenOverlay
88

99
@OptIn(WorkflowUiExperimentalApi::class)
1010
typealias MayBeLoadingScreen =
11-
BodyAndModalsScreen<ScrimScreen<OverviewDetailScreen>, ModalScreenOverlay<LoaderSpinner>>
11+
BodyAndOverlaysScreen<ScrimScreen<OverviewDetailScreen>, FullScreenOverlay<LoaderSpinner>>
1212

1313
@OptIn(WorkflowUiExperimentalApi::class)
1414
fun MayBeLoadingScreen(
1515
baseScreen: OverviewDetailScreen,
1616
loaders: List<LoaderSpinner> = emptyList()
1717
): MayBeLoadingScreen {
18-
return BodyAndModalsScreen(
18+
return BodyAndOverlaysScreen(
1919
ScrimScreen(baseScreen, dimmed = loaders.isNotEmpty()),
20-
loaders.map { ModalScreenOverlay(it) }
20+
loaders.map { FullScreenOverlay(it) }
2121
)
2222
}
2323

samples/containers/android/src/main/java/com/squareup/sample/container/panel/PanelOverlayDialogFactory.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import android.graphics.Rect
55
import android.view.View
66
import com.squareup.sample.container.R
77
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
8-
import com.squareup.workflow1.ui.container.ModalScreenOverlayDialogFactory
8+
import com.squareup.workflow1.ui.container.ScreenOverlayDialogFactory
99
import com.squareup.workflow1.ui.container.setModalContent
1010

1111
/**
1212
* Android support for [PanelOverlay].
1313
*/
1414
@OptIn(WorkflowUiExperimentalApi::class)
15-
internal object PanelOverlayDialogFactory : ModalScreenOverlayDialogFactory<PanelOverlay<*>>(
15+
internal object PanelOverlayDialogFactory : ScreenOverlayDialogFactory<PanelOverlay<*>>(
1616
type = PanelOverlay::class
1717
) {
1818
/**

samples/containers/hello-back-button/src/main/java/com/squareup/sample/hellobackbutton/AreYouSureWorkflow.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import com.squareup.workflow1.ui.container.AlertOverlay.Button.POSITIVE
1616
import com.squareup.workflow1.ui.container.AlertOverlay.Event.ButtonClicked
1717
import com.squareup.workflow1.ui.container.AlertOverlay.Event.Canceled
1818
import com.squareup.workflow1.ui.container.BackButtonScreen
19-
import com.squareup.workflow1.ui.container.BodyAndModalsScreen
19+
import com.squareup.workflow1.ui.container.BodyAndOverlaysScreen
2020
import com.squareup.workflow1.ui.toParcelable
2121
import com.squareup.workflow1.ui.toSnapshot
2222
import kotlinx.parcelize.Parcelize
@@ -27,7 +27,7 @@ import kotlinx.parcelize.Parcelize
2727
*/
2828
@OptIn(WorkflowUiExperimentalApi::class)
2929
object AreYouSureWorkflow :
30-
StatefulWorkflow<Unit, State, Finished, BodyAndModalsScreen<*, AlertOverlay>>() {
30+
StatefulWorkflow<Unit, State, Finished, BodyAndOverlaysScreen<*, AlertOverlay>>() {
3131
override fun initialState(
3232
props: Unit,
3333
snapshot: Snapshot?
@@ -45,12 +45,12 @@ object AreYouSureWorkflow :
4545
renderProps: Unit,
4646
renderState: State,
4747
context: RenderContext
48-
): BodyAndModalsScreen<*, AlertOverlay> {
48+
): BodyAndOverlaysScreen<*, AlertOverlay> {
4949
val ableBakerCharlie = context.renderChild(HelloBackButtonWorkflow, Unit) { noAction() }
5050

5151
return when (renderState) {
5252
Running -> {
53-
BodyAndModalsScreen(
53+
BodyAndOverlaysScreen(
5454
BackButtonScreen(ableBakerCharlie) {
5555
// While we always provide a back button handler, by default the view code
5656
// associated with BackButtonScreen ignores ours if the view created for the
@@ -80,7 +80,7 @@ object AreYouSureWorkflow :
8080
}
8181
)
8282

83-
BodyAndModalsScreen(ableBakerCharlie, alert)
83+
BodyAndOverlaysScreen(ableBakerCharlie, alert)
8484
}
8585
}
8686
}

samples/tictactoe/common/src/main/java/com/squareup/sample/mainworkflow/TicTacToeWorkflow.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import com.squareup.workflow1.action
2121
import com.squareup.workflow1.renderChild
2222
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
2323
import com.squareup.workflow1.ui.container.BackStackScreen
24-
import com.squareup.workflow1.ui.container.BodyAndModalsScreen
24+
import com.squareup.workflow1.ui.container.BodyAndOverlaysScreen
2525

2626
/**
2727
* Application specific root [Workflow], and demonstration of workflow composition.
@@ -45,7 +45,7 @@ import com.squareup.workflow1.ui.container.BodyAndModalsScreen
4545
class TicTacToeWorkflow(
4646
private val authWorkflow: AuthWorkflow,
4747
private val runGameWorkflow: RunGameWorkflow
48-
) : StatefulWorkflow<Unit, MainState, Unit, BodyAndModalsScreen<ScrimScreen<*>, *>>() {
48+
) : StatefulWorkflow<Unit, MainState, Unit, BodyAndOverlaysScreen<ScrimScreen<*>, *>>() {
4949

5050
override fun initialState(
5151
props: Unit,
@@ -57,8 +57,8 @@ class TicTacToeWorkflow(
5757
renderProps: Unit,
5858
renderState: MainState,
5959
context: RenderContext
60-
): BodyAndModalsScreen<ScrimScreen<*>, *> {
61-
val bodyAndOverlays: BodyAndModalsScreen<*, *> = when (renderState) {
60+
): BodyAndOverlaysScreen<ScrimScreen<*>, *> {
61+
val bodyAndOverlays: BodyAndOverlaysScreen<*, *> = when (renderState) {
6262
is Authenticating -> {
6363
val authBackStack = context.renderChild(authWorkflow) { handleAuthResult(it) }
6464
// We always show an empty GameScreen behind the PanelOverlay that
@@ -68,14 +68,14 @@ class TicTacToeWorkflow(
6868
// cheat is probably the most realistic thing about this sample.
6969
val emptyGameScreen = GamePlayScreen()
7070

71-
BodyAndModalsScreen(emptyGameScreen, PanelOverlay(authBackStack))
71+
BodyAndOverlaysScreen(emptyGameScreen, PanelOverlay(authBackStack))
7272
}
7373

7474
is RunningGame -> {
7575
val gameRendering = context.renderChild(runGameWorkflow) { startAuth }
7676

7777
if (gameRendering.namePrompt == null) {
78-
BodyAndModalsScreen(gameRendering.gameScreen, gameRendering.alerts)
78+
BodyAndOverlaysScreen(gameRendering.gameScreen, gameRendering.alerts)
7979
} else {
8080
// To prompt for player names, the child puts up a ScreenOverlay, which
8181
// we replace here with a tasteful PanelOverlay.
@@ -95,7 +95,7 @@ class TicTacToeWorkflow(
9595
BackStackScreen(gameRendering.namePrompt.content)
9696
val allModals = listOf(PanelOverlay(fullBackStack)) + gameRendering.alerts
9797

98-
BodyAndModalsScreen(gameRendering.gameScreen, allModals)
98+
BodyAndOverlaysScreen(gameRendering.gameScreen, allModals)
9999
}
100100
}
101101
}

samples/tictactoe/common/src/test/java/com/squareup/sample/mainworkflow/TicTacToeWorkflowTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import com.squareup.workflow1.testing.launchForTestingFromStartWith
1818
import com.squareup.workflow1.ui.Screen
1919
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
2020
import com.squareup.workflow1.ui.container.BackStackScreen
21-
import com.squareup.workflow1.ui.container.BodyAndModalsScreen
21+
import com.squareup.workflow1.ui.container.BodyAndOverlaysScreen
2222
import org.junit.Test
2323

2424
/**
@@ -63,7 +63,7 @@ class TicTacToeWorkflowTest {
6363
private fun authScreen(wrapped: String = DEFAULT_AUTH) =
6464
BackStackScreen<Screen>(S(wrapped))
6565

66-
private val BodyAndModalsScreen<ScrimScreen<*>, *>.panels: List<PanelOverlay<*>>
66+
private val BodyAndOverlaysScreen<ScrimScreen<*>, *>.panels: List<PanelOverlay<*>>
6767
get() = overlays.mapNotNull { it as? PanelOverlay<*> }
6868

6969
private fun authWorkflow(

workflow-ui/compose/src/androidTest/java/com/squareup/workflow1/ui/compose/ComposeViewTreeIntegrationTest.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ import com.squareup.workflow1.ui.ViewRegistry
3535
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
3636
import com.squareup.workflow1.ui.container.AndroidOverlay
3737
import com.squareup.workflow1.ui.container.BackStackScreen
38-
import com.squareup.workflow1.ui.container.BodyAndModalsScreen
39-
import com.squareup.workflow1.ui.container.ModalScreenOverlayDialogFactory
38+
import com.squareup.workflow1.ui.container.BodyAndOverlaysScreen
4039
import com.squareup.workflow1.ui.container.ScreenOverlay
40+
import com.squareup.workflow1.ui.container.ScreenOverlayDialogFactory
4141
import com.squareup.workflow1.ui.internal.test.DetectLeaksAfterTestSuccess
4242
import com.squareup.workflow1.ui.internal.test.IdleAfterTestRule
4343
import com.squareup.workflow1.ui.internal.test.IdlingDispatcherRule
@@ -371,7 +371,7 @@ internal class ComposeViewTreeIntegrationTest {
371371
// Show first screen to initialize state.
372372
scenario.onActivity {
373373
it.setRendering(
374-
BodyAndModalsScreen(
374+
BodyAndOverlaysScreen(
375375
EmptyRendering, TestModal(BackStackScreen(EmptyRendering, firstScreen))
376376
)
377377
)
@@ -426,7 +426,7 @@ internal class ComposeViewTreeIntegrationTest {
426426
// Show first screen to initialize state.
427427
scenario.onActivity {
428428
it.setRendering(
429-
BodyAndModalsScreen(
429+
BodyAndOverlaysScreen(
430430
EmptyRendering, TestModal(firstScreen), TestModal(secondScreen), TestModal(thirdScreen)
431431
)
432432
)
@@ -485,7 +485,7 @@ internal class ComposeViewTreeIntegrationTest {
485485
// Show first screen to initialize state.
486486
scenario.onActivity {
487487
it.setRendering(
488-
BodyAndModalsScreen(
488+
BodyAndOverlaysScreen(
489489
EmptyRendering,
490490
TestModal(BackStackScreen(EmptyRendering, layer0Screen0)),
491491
TestModal(BackStackScreen(EmptyRendering, layer1Screen0)),
@@ -508,7 +508,7 @@ internal class ComposeViewTreeIntegrationTest {
508508
// Push some screens onto the backstack.
509509
scenario.onActivity {
510510
it.setRendering(
511-
BodyAndModalsScreen(
511+
BodyAndOverlaysScreen(
512512
EmptyRendering,
513513
TestModal(BackStackScreen(EmptyRendering, layer0Screen0, layer0Screen1)),
514514
TestModal(BackStackScreen(EmptyRendering, layer1Screen0, layer1Screen1)),
@@ -545,7 +545,7 @@ internal class ComposeViewTreeIntegrationTest {
545545
// Pop both backstacks and check that screens were restored.
546546
scenario.onActivity {
547547
it.setRendering(
548-
BodyAndModalsScreen(
548+
BodyAndOverlaysScreen(
549549
EmptyRendering,
550550
TestModal(BackStackScreen(EmptyRendering, layer0Screen0)),
551551
TestModal(BackStackScreen(EmptyRendering, layer1Screen0)),
@@ -566,7 +566,7 @@ internal class ComposeViewTreeIntegrationTest {
566566
data class TestModal(
567567
override val content: Screen
568568
) : ScreenOverlay<Screen>, AndroidOverlay<TestModal> {
569-
override val dialogFactory = object : ModalScreenOverlayDialogFactory<TestModal>(
569+
override val dialogFactory = object : ScreenOverlayDialogFactory<TestModal>(
570570
TestModal::class
571571
) {
572572
override fun buildDialogWithContentView(contentView: View): Dialog {

workflow-ui/container-common/src/main/java/com/squareup/workflow1/ui/modal/AlertContainerScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
77
/**
88
* **This will be deprecated in favor of
99
* [AlertOverlay][com.squareup.workflow1.ui.container.AlertOverlay] and
10-
* [BodyAndModalsScreen][com.squareup.workflow1.ui.container.BodyAndModalsScreen]
10+
* [BodyAndModalsScreen][com.squareup.workflow1.ui.container.BodyAndOverlaysScreen]
1111
* very soon.**
1212
*
1313
* May show a stack of [AlertScreen] over a [beneathModals].

workflow-ui/container-common/src/main/java/com/squareup/workflow1/ui/modal/HasModals.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
44

55
/**
66
* **This will be deprecated in favor of
7-
* [BodyAndModalsScreen][com.squareup.workflow1.ui.container.BodyAndModalsScreen]
7+
* [BodyAndModalsScreen][com.squareup.workflow1.ui.container.BodyAndOverlaysScreen]
88
* very soon.**
99
*
1010
* Interface implemented by screen classes that represent a stack of

0 commit comments

Comments
 (0)