Skip to content

Commit 3bb7596

Browse files
committed
Eliminates the useless type property from ViewEnvironmentKey.
1 parent 9b15bdb commit 3bb7596

File tree

19 files changed

+40
-40
lines changed

19 files changed

+40
-40
lines changed

samples/containers/android/src/main/java/com/squareup/sample/container/overviewdetail/OverviewDetailConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ enum class OverviewDetailConfig {
3131
Single;
3232

3333
@OptIn(WorkflowUiExperimentalApi::class)
34-
companion object : ViewEnvironmentKey<OverviewDetailConfig>(OverviewDetailConfig::class) {
34+
companion object : ViewEnvironmentKey<OverviewDetailConfig>() {
3535
override val default = None
3636
}
3737
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ internal class LegacyPreviewViewFactoryTest {
164164
)
165165
}
166166

167-
object TestEnvironmentKey : ViewEnvironmentKey<String>(String::class) {
167+
object TestEnvironmentKey : ViewEnvironmentKey<String>() {
168168
override val default: String get() = error("Not specified")
169169
}
170170

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ internal class PreviewViewFactoryTest {
194194
)
195195
}
196196

197-
object TestEnvironmentKey : ViewEnvironmentKey<String>(String::class) {
197+
object TestEnvironmentKey : ViewEnvironmentKey<String>() {
198198
override val default: String get() = error("Not specified")
199199
}
200200

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ internal class ComposeViewFactoryTest {
7878
}
7979

8080
@Test fun getsViewEnvironmentUpdates() {
81-
val testEnvironmentKey = object : ViewEnvironmentKey<String>(String::class) {
81+
val testEnvironmentKey = object : ViewEnvironmentKey<String>() {
8282
override val default: String get() = error("No default")
8383
}
8484

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ internal class LegacyComposeViewFactoryTest {
7979
}
8080

8181
@Test fun getsViewEnvironmentUpdates() {
82-
val testEnvironmentKey = object : ViewEnvironmentKey<String>(String::class) {
82+
val testEnvironmentKey = object : ViewEnvironmentKey<String>() {
8383
override val default: String get() = error("No default")
8484
}
8585

workflow-ui/core-android/src/androidTest/java/com/squareup/workflow1/ui/DecorativeViewFactoryTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal class DecorativeViewFactoryTest {
3030
}
3131
}
3232

33-
val envString = object : ViewEnvironmentKey<String>(String::class) {
33+
val envString = object : ViewEnvironmentKey<String>() {
3434
override val default: String get() = "Not set"
3535
}
3636

@@ -120,7 +120,7 @@ internal class DecorativeViewFactoryTest {
120120
}
121121
}
122122

123-
val envString = object : ViewEnvironmentKey<String>(String::class) {
123+
val envString = object : ViewEnvironmentKey<String>() {
124124
override val default: String get() = "Not set"
125125
}
126126

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ public interface ScreenViewFactoryFinder {
8585
)
8686
}
8787

88-
public companion object : ViewEnvironmentKey<ScreenViewFactoryFinder>(
89-
ScreenViewFactoryFinder::class
90-
) {
88+
public companion object : ViewEnvironmentKey<ScreenViewFactoryFinder>() {
9189
override val default: ScreenViewFactoryFinder
9290
get() = object : ScreenViewFactoryFinder {}
9391
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
88
* for the `@StyleRes themeResId: Int` argument of `AlertDialog.Builder()`.
99
*/
1010
@WorkflowUiExperimentalApi
11-
public object AlertDialogThemeResId : ViewEnvironmentKey<Int>(type = Int::class) {
11+
public object AlertDialogThemeResId : ViewEnvironmentKey<Int>() {
1212
override val default: Int = 0
1313
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public enum class BackStackConfig {
2929
*/
3030
Other;
3131

32-
public companion object : ViewEnvironmentKey<BackStackConfig>(BackStackConfig::class) {
32+
public companion object : ViewEnvironmentKey<BackStackConfig>() {
3333
override val default: BackStackConfig = None
3434
}
3535
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
1212
* https://stackoverflow.com/questions/2886407/dealing-with-rapid-tapping-on-buttons
1313
*/
1414
@WorkflowUiExperimentalApi
15-
internal object CoveredByModal : ViewEnvironmentKey<Boolean>(type = Boolean::class) {
15+
internal object CoveredByModal : ViewEnvironmentKey<Boolean>() {
1616
override val default: Boolean = false
1717
}

0 commit comments

Comments
 (0)