From 5dfb8aa1fe299913cff85504466de59d1e8770a0 Mon Sep 17 00:00:00 2001 From: Ray Ryan Date: Mon, 29 Jul 2024 10:22:00 -0700 Subject: [PATCH] BREAKING: Renames `BackStackConfig.Other` to `CanGoBack` Just trying to make it easier to understand. --- .../java/com/squareup/sample/poetry/StanzaListScreen.kt | 4 ++-- .../java/com/squareup/sample/todo/TodoEditorScreen.kt | 4 ++-- .../workflow1/ui/navigation/BackStackContainer.kt | 4 ++-- workflow-ui/core-common/api/core-common.api | 2 +- .../squareup/workflow1/ui/navigation/BackStackConfig.kt | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/samples/containers/poetry/src/main/java/com/squareup/sample/poetry/StanzaListScreen.kt b/samples/containers/poetry/src/main/java/com/squareup/sample/poetry/StanzaListScreen.kt index 949ea2e01..f829be5e3 100644 --- a/samples/containers/poetry/src/main/java/com/squareup/sample/poetry/StanzaListScreen.kt +++ b/samples/containers/poetry/src/main/java/com/squareup/sample/poetry/StanzaListScreen.kt @@ -17,7 +17,7 @@ import com.squareup.workflow1.ui.ScreenViewRunner import com.squareup.workflow1.ui.ViewEnvironment import com.squareup.workflow1.ui.WorkflowUiExperimentalApi import com.squareup.workflow1.ui.navigation.BackStackConfig -import com.squareup.workflow1.ui.navigation.BackStackConfig.Other +import com.squareup.workflow1.ui.navigation.BackStackConfig.CanGoBack import com.squareup.workflow1.ui.navigation.setBackHandler @OptIn(WorkflowUiExperimentalApi::class) @@ -53,7 +53,7 @@ private class StanzaListLayoutRunner(view: View) : ScreenViewRunner> = newRendering diff --git a/workflow-ui/core-common/api/core-common.api b/workflow-ui/core-common/api/core-common.api index 28781a928..747172f8c 100644 --- a/workflow-ui/core-common/api/core-common.api +++ b/workflow-ui/core-common/api/core-common.api @@ -191,10 +191,10 @@ public final class com/squareup/workflow1/ui/navigation/AlertOverlay$Event$Cance } public final class com/squareup/workflow1/ui/navigation/BackStackConfig : java/lang/Enum { + public static final field CanGoBack Lcom/squareup/workflow1/ui/navigation/BackStackConfig; public static final field Companion Lcom/squareup/workflow1/ui/navigation/BackStackConfig$Companion; public static final field First Lcom/squareup/workflow1/ui/navigation/BackStackConfig; public static final field None Lcom/squareup/workflow1/ui/navigation/BackStackConfig; - public static final field Other Lcom/squareup/workflow1/ui/navigation/BackStackConfig; public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lcom/squareup/workflow1/ui/navigation/BackStackConfig; public static fun values ()[Lcom/squareup/workflow1/ui/navigation/BackStackConfig; diff --git a/workflow-ui/core-common/src/main/java/com/squareup/workflow1/ui/navigation/BackStackConfig.kt b/workflow-ui/core-common/src/main/java/com/squareup/workflow1/ui/navigation/BackStackConfig.kt index 28702b918..5d8a2049c 100644 --- a/workflow-ui/core-common/src/main/java/com/squareup/workflow1/ui/navigation/BackStackConfig.kt +++ b/workflow-ui/core-common/src/main/java/com/squareup/workflow1/ui/navigation/BackStackConfig.kt @@ -3,12 +3,12 @@ package com.squareup.workflow1.ui.navigation import com.squareup.workflow1.ui.ViewEnvironment import com.squareup.workflow1.ui.ViewEnvironmentKey import com.squareup.workflow1.ui.WorkflowUiExperimentalApi -import com.squareup.workflow1.ui.navigation.BackStackConfig.First -import com.squareup.workflow1.ui.navigation.BackStackConfig.Other /** * Informs views whether they're children of a [BackStackScreen], - * and if so whether they're the [first frame][First] or [not][Other]. + * and if so whether they're the + * [first frame][com.squareup.workflow1.ui.navigation.BackStackConfig.First] + * or [not][com.squareup.workflow1.ui.navigation.BackStackConfig.CanGoBack]. */ @WorkflowUiExperimentalApi public enum class BackStackConfig { @@ -27,7 +27,7 @@ public enum class BackStackConfig { * This rendering is in a [BackStackScreen] but is not the first frame. * Useful as a hint to enable "go back" behavior. */ - Other; + CanGoBack; public companion object : ViewEnvironmentKey() { override val default: BackStackConfig = None