Skip to content

Commit a6fa11c

Browse files
authored
Merge pull request #734 from square/ray/next-tweak
More consistent use of Compatible.keyFor
2 parents fe85b02 + a1d99e5 commit a6fa11c

File tree

7 files changed

+7
-8
lines changed

7 files changed

+7
-8
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android.useAndroidX=true
88
systemProp.org.gradle.internal.publish.checksums.insecure=true
99

1010
GROUP=com.squareup.workflow1
11-
VERSION_NAME=1.8.0-uiUpdate02-SNAPSHOT
11+
VERSION_NAME=1.8.0-uiUpdate03-SNAPSHOT
1212

1313
POM_DESCRIPTION=Square Workflow
1414

workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/container/BackStackContainer.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import com.squareup.workflow1.ui.canShow
2828
import com.squareup.workflow1.ui.compatible
2929
import com.squareup.workflow1.ui.container.BackStackConfig.First
3030
import com.squareup.workflow1.ui.container.BackStackConfig.Other
31-
import com.squareup.workflow1.ui.container.ViewStateCache.Saved
3231
import com.squareup.workflow1.ui.show
3332
import com.squareup.workflow1.ui.startShowing
3433
import com.squareup.workflow1.ui.toViewFactory
@@ -201,7 +200,7 @@ public open class BackStackContainer @JvmOverloads constructor(
201200
}
202201

203202
public constructor(source: Parcel) : super(source) {
204-
this.savedViewState = source.readParcelable(ViewStateCache.Saved::class.java.classLoader)!!
203+
savedViewState = source.readParcelable(ViewStateCache.Saved::class.java.classLoader)!!
205204
}
206205

207206
public val savedViewState: ViewStateCache.Saved

workflow-ui/core-common/src/main/java/com/squareup/workflow1/ui/AsScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class AsScreen<W : Any>(
1919
}
2020

2121
override val compatibilityKey: String
22-
get() = Compatible.keyFor(rendering)
22+
get() = Compatible.keyFor(rendering, "AsScreen")
2323
}
2424

2525
/**

workflow-ui/core-common/src/main/java/com/squareup/workflow1/ui/Named.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public data class Named<W : Any>(
1515
require(name.isNotBlank()) { "name must not be blank." }
1616
}
1717

18-
override val compatibilityKey: String = Compatible.keyFor(wrapped, name)
18+
override val compatibilityKey: String = Compatible.keyFor(wrapped, "Named($name)")
1919

2020
override fun toString(): String {
2121
return "${super.toString()}: $compatibilityKey"

workflow-ui/core-common/src/main/java/com/squareup/workflow1/ui/NamedScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public data class NamedScreen<W : Screen>(
1616
require(name.isNotBlank()) { "name must not be blank." }
1717
}
1818

19-
override val compatibilityKey: String = Compatible.keyFor(wrapped, name)
19+
override val compatibilityKey: String = Compatible.keyFor(wrapped, "NamedScreen($name)")
2020

2121
override fun toString(): String {
2222
return "${super.toString()}: $compatibilityKey"

workflow-ui/core-common/src/test/java/com/squareup/workflow1/ui/NamedScreenTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ internal class NamedScreenTest {
5858

5959
@Test fun `recursive keys are legible`() {
6060
assertThat(NamedScreen(NamedScreen(Hey, "one"), "ho").compatibilityKey)
61-
.isEqualTo("com.squareup.workflow1.ui.NamedScreenTest\$Hey+one+ho")
61+
.isEqualTo("com.squareup.workflow1.ui.NamedScreenTest\$Hey+NamedScreen(one)+NamedScreen(ho)")
6262
}
6363

6464
private class Foo(override val compatibilityKey: String) : Compatible, Screen

workflow-ui/core-common/src/test/java/com/squareup/workflow1/ui/NamedTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ internal class NamedTest {
5858

5959
@Test fun `recursive keys are legible`() {
6060
assertThat(Named(Named(Hey, "one"), "ho").compatibilityKey)
61-
.isEqualTo("com.squareup.workflow1.ui.NamedTest\$Hey+one+ho")
61+
.isEqualTo("com.squareup.workflow1.ui.NamedTest\$Hey+Named(one)+Named(ho)")
6262
}
6363

6464
private class Foo(override val compatibilityKey: String) : Compatible

0 commit comments

Comments
 (0)