File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed
containers/poetry/src/main/java/com/squareup/sample/poetry
todo-android/app/src/main/java/com/squareup/sample/todo
core-android/src/main/java/com/squareup/workflow1/ui/navigation
src/main/java/com/squareup/workflow1/ui/navigation Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import com.squareup.workflow1.ui.ScreenViewRunner
17
17
import com.squareup.workflow1.ui.ViewEnvironment
18
18
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
19
19
import com.squareup.workflow1.ui.navigation.BackStackConfig
20
- import com.squareup.workflow1.ui.navigation.BackStackConfig.Other
20
+ import com.squareup.workflow1.ui.navigation.BackStackConfig.CanGoBack
21
21
import com.squareup.workflow1.ui.navigation.setBackHandler
22
22
23
23
@OptIn(WorkflowUiExperimentalApi ::class )
@@ -53,7 +53,7 @@ private class StanzaListLayoutRunner(view: View) : ScreenViewRunner<StanzaListSc
53
53
toolbar.title = rendering.title
54
54
toolbar.subtitle = rendering.subtitle
55
55
56
- if (environment[BackStackConfig ] == Other ) {
56
+ if (environment[BackStackConfig ] == CanGoBack ) {
57
57
toolbar.setNavigationOnClickListener { rendering.onExit() }
58
58
toolbar.setBackHandler(rendering.onExit)
59
59
} else {
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import com.squareup.workflow1.ui.ViewEnvironment
14
14
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
15
15
import com.squareup.workflow1.ui.control
16
16
import com.squareup.workflow1.ui.navigation.BackStackConfig
17
- import com.squareup.workflow1.ui.navigation.BackStackConfig.Other
17
+ import com.squareup.workflow1.ui.navigation.BackStackConfig.CanGoBack
18
18
import com.squareup.workflow1.ui.navigation.setBackHandler
19
19
20
20
@OptIn(WorkflowUiExperimentalApi ::class )
@@ -60,7 +60,7 @@ private class Runner(
60
60
rendering.session.title.control(todoTitle)
61
61
itemListView.setRows(rendering.session.rows)
62
62
63
- if (environment[BackStackConfig ] == Other ) {
63
+ if (environment[BackStackConfig ] == CanGoBack ) {
64
64
todoEditorToolbar.setNavigationOnClickListener { rendering.onGoBackClicked() }
65
65
root.setBackHandler(rendering.onGoBackClicked)
66
66
} else {
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ import com.squareup.workflow1.ui.androidx.WorkflowAndroidXSupport.stateRegistryO
28
28
import com.squareup.workflow1.ui.androidx.WorkflowLifecycleOwner
29
29
import com.squareup.workflow1.ui.canShow
30
30
import com.squareup.workflow1.ui.compatible
31
+ import com.squareup.workflow1.ui.navigation.BackStackConfig.CanGoBack
31
32
import com.squareup.workflow1.ui.navigation.BackStackConfig.First
32
- import com.squareup.workflow1.ui.navigation.BackStackConfig.Other
33
33
import com.squareup.workflow1.ui.screen
34
34
import com.squareup.workflow1.ui.show
35
35
import com.squareup.workflow1.ui.startShowing
@@ -71,7 +71,7 @@ public open class BackStackContainer @JvmOverloads constructor(
71
71
) {
72
72
savedStateParentKey = keyFor(screen)
73
73
74
- val config = if (newRendering.backStack.isEmpty()) First else Other
74
+ val config = if (newRendering.backStack.isEmpty()) First else CanGoBack
75
75
val environment = newViewEnvironment + config
76
76
77
77
val named: BackStackScreen <NamedScreen <* >> = newRendering
Original file line number Diff line number Diff line change @@ -191,10 +191,10 @@ public final class com/squareup/workflow1/ui/navigation/AlertOverlay$Event$Cance
191
191
}
192
192
193
193
public final class com/squareup/workflow1/ui/navigation/BackStackConfig : java/lang/Enum {
194
+ public static final field CanGoBack Lcom/squareup/workflow1/ui/navigation/BackStackConfig;
194
195
public static final field Companion Lcom/squareup/workflow1/ui/navigation/BackStackConfig$Companion;
195
196
public static final field First Lcom/squareup/workflow1/ui/navigation/BackStackConfig;
196
197
public static final field None Lcom/squareup/workflow1/ui/navigation/BackStackConfig;
197
- public static final field Other Lcom/squareup/workflow1/ui/navigation/BackStackConfig;
198
198
public static fun getEntries ()Lkotlin/enums/EnumEntries;
199
199
public static fun valueOf (Ljava/lang/String;)Lcom/squareup/workflow1/ui/navigation/BackStackConfig;
200
200
public static fun values ()[Lcom/squareup/workflow1/ui/navigation/BackStackConfig;
Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ package com.squareup.workflow1.ui.navigation
3
3
import com.squareup.workflow1.ui.ViewEnvironment
4
4
import com.squareup.workflow1.ui.ViewEnvironmentKey
5
5
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
6
- import com.squareup.workflow1.ui.navigation.BackStackConfig.First
7
- import com.squareup.workflow1.ui.navigation.BackStackConfig.Other
8
6
9
7
/* *
10
8
* Informs views whether they're children of a [BackStackScreen],
11
- * and if so whether they're the [first frame][First] or [not][Other].
9
+ * and if so whether they're the
10
+ * [first frame][com.squareup.workflow1.ui.navigation.BackStackConfig.First]
11
+ * or [not][com.squareup.workflow1.ui.navigation.BackStackConfig.CanGoBack].
12
12
*/
13
13
@WorkflowUiExperimentalApi
14
14
public enum class BackStackConfig {
@@ -27,7 +27,7 @@ public enum class BackStackConfig {
27
27
* This rendering is in a [BackStackScreen] but is not the first frame.
28
28
* Useful as a hint to enable "go back" behavior.
29
29
*/
30
- Other ;
30
+ CanGoBack ;
31
31
32
32
public companion object : ViewEnvironmentKey <BackStackConfig >() {
33
33
override val default: BackStackConfig = None
You can’t perform that action at this time.
0 commit comments