Skip to content

Commit 9a5bd11

Browse files
Merge pull request #1090 from square/sedwards/update-deps
Update AndroidX Dependencies
2 parents 6697056 + 638c209 commit 9a5bd11

File tree

26 files changed

+173
-143
lines changed

26 files changed

+173
-143
lines changed

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ androidx-compose-compiler = "1.4.4"
1414
# see https://developer.android.com/jetpack/compose/bom/bom-mapping
1515
androidx-compose-bom = "2023.01.00"
1616
androidx-constraintlayout = "2.1.4"
17-
androidx-core = "1.6.0"
17+
androidx-core = "1.10.0"
1818
androidx-fragment = "1.3.6"
1919
androidx-gridlayout = "1.0.0"
20-
androidx-lifecycle = "2.5.1"
20+
androidx-lifecycle = "2.6.1"
2121
androidx-navigation = "2.4.0-alpha09"
2222
androidx-paging = "3.0.1"
2323
androidx-profileinstaller = "1.2.0-alpha02"
@@ -33,7 +33,7 @@ androidx-test-truth-ext = "1.5.0"
3333
androidx-tracing = "1.1.0"
3434
androidx-transition = "1.4.1"
3535
androidx-viewbinding = "4.2.1"
36-
androidx-work = "2.6.0"
36+
androidx-work = "2.7.0"
3737

3838
detekt = "1.19.0"
3939
dokka = "1.8.20"

workflow-ui/compose-tooling/dependencies/releaseRuntimeClasspath.txt

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
androidx.activity:activity-compose:1.6.1
22
androidx.activity:activity-ktx:1.6.1
33
androidx.activity:activity:1.6.1
4-
androidx.annotation:annotation-experimental:1.1.0
5-
androidx.annotation:annotation:1.5.0
6-
androidx.arch.core:core-common:2.1.0
7-
androidx.arch.core:core-runtime:2.1.0
4+
androidx.annotation:annotation-experimental:1.3.0
5+
androidx.annotation:annotation-jvm:1.6.0
6+
androidx.annotation:annotation:1.6.0
7+
androidx.arch.core:core-common:2.2.0
8+
androidx.arch.core:core-runtime:2.2.0
89
androidx.autofill:autofill:1.0.0
910
androidx.collection:collection:1.1.0
1011
androidx.compose.animation:animation-core:1.3.3
@@ -21,19 +22,20 @@ androidx.compose.ui:ui-unit:1.3.3
2122
androidx.compose.ui:ui-util:1.3.3
2223
androidx.compose.ui:ui:1.3.3
2324
androidx.compose:compose-bom:2023.01.00
24-
androidx.concurrent:concurrent-futures:1.0.0
25-
androidx.core:core-ktx:1.6.0
26-
androidx.core:core:1.8.0
25+
androidx.concurrent:concurrent-futures:1.1.0
26+
androidx.core:core-ktx:1.10.0
27+
androidx.core:core:1.10.0
2728
androidx.customview:customview-poolingcontainer:1.0.0
28-
androidx.lifecycle:lifecycle-common-java8:2.5.1
29-
androidx.lifecycle:lifecycle-common:2.5.1
30-
androidx.lifecycle:lifecycle-livedata-core:2.5.1
31-
androidx.lifecycle:lifecycle-runtime-ktx:2.5.1
32-
androidx.lifecycle:lifecycle-runtime:2.5.1
33-
androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1
34-
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1
35-
androidx.lifecycle:lifecycle-viewmodel:2.5.1
36-
androidx.profileinstaller:profileinstaller:1.2.0
29+
androidx.interpolator:interpolator:1.0.0
30+
androidx.lifecycle:lifecycle-common-java8:2.6.1
31+
androidx.lifecycle:lifecycle-common:2.6.1
32+
androidx.lifecycle:lifecycle-livedata-core:2.6.1
33+
androidx.lifecycle:lifecycle-runtime-ktx:2.6.1
34+
androidx.lifecycle:lifecycle-runtime:2.6.1
35+
androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1
36+
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1
37+
androidx.lifecycle:lifecycle-viewmodel:2.6.1
38+
androidx.profileinstaller:profileinstaller:1.3.0
3739
androidx.savedstate:savedstate-ktx:1.2.1
3840
androidx.savedstate:savedstate:1.2.1
3941
androidx.startup:startup-runtime:1.1.1

workflow-ui/compose/dependencies/releaseRuntimeClasspath.txt

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
androidx.activity:activity-compose:1.6.1
22
androidx.activity:activity-ktx:1.6.1
33
androidx.activity:activity:1.6.1
4-
androidx.annotation:annotation-experimental:1.1.0
5-
androidx.annotation:annotation:1.5.0
6-
androidx.arch.core:core-common:2.1.0
7-
androidx.arch.core:core-runtime:2.1.0
4+
androidx.annotation:annotation-experimental:1.3.0
5+
androidx.annotation:annotation-jvm:1.6.0
6+
androidx.annotation:annotation:1.6.0
7+
androidx.arch.core:core-common:2.2.0
8+
androidx.arch.core:core-runtime:2.2.0
89
androidx.autofill:autofill:1.0.0
910
androidx.collection:collection:1.1.0
1011
androidx.compose.animation:animation-core:1.3.3
@@ -18,19 +19,20 @@ androidx.compose.ui:ui-unit:1.3.3
1819
androidx.compose.ui:ui-util:1.3.3
1920
androidx.compose.ui:ui:1.3.3
2021
androidx.compose:compose-bom:2023.01.00
21-
androidx.concurrent:concurrent-futures:1.0.0
22-
androidx.core:core-ktx:1.6.0
23-
androidx.core:core:1.8.0
22+
androidx.concurrent:concurrent-futures:1.1.0
23+
androidx.core:core-ktx:1.10.0
24+
androidx.core:core:1.10.0
2425
androidx.customview:customview-poolingcontainer:1.0.0
25-
androidx.lifecycle:lifecycle-common-java8:2.5.1
26-
androidx.lifecycle:lifecycle-common:2.5.1
27-
androidx.lifecycle:lifecycle-livedata-core:2.5.1
28-
androidx.lifecycle:lifecycle-runtime-ktx:2.5.1
29-
androidx.lifecycle:lifecycle-runtime:2.5.1
30-
androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1
31-
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1
32-
androidx.lifecycle:lifecycle-viewmodel:2.5.1
33-
androidx.profileinstaller:profileinstaller:1.2.0
26+
androidx.interpolator:interpolator:1.0.0
27+
androidx.lifecycle:lifecycle-common-java8:2.6.1
28+
androidx.lifecycle:lifecycle-common:2.6.1
29+
androidx.lifecycle:lifecycle-livedata-core:2.6.1
30+
androidx.lifecycle:lifecycle-runtime-ktx:2.6.1
31+
androidx.lifecycle:lifecycle-runtime:2.6.1
32+
androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1
33+
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1
34+
androidx.lifecycle:lifecycle-viewmodel:2.6.1
35+
androidx.profileinstaller:profileinstaller:1.3.0
3436
androidx.savedstate:savedstate-ktx:1.2.1
3537
androidx.savedstate:savedstate:1.2.1
3638
androidx.startup:startup-runtime:1.1.1

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import androidx.lifecycle.Lifecycle.State.STARTED
5050
import androidx.lifecycle.LifecycleEventObserver
5151
import androidx.lifecycle.LifecycleOwner
5252
import androidx.lifecycle.LifecycleRegistry
53-
import androidx.lifecycle.ViewTreeLifecycleOwner
53+
import androidx.lifecycle.findViewTreeLifecycleOwner
5454
import androidx.test.espresso.Espresso.onView
5555
import androidx.test.espresso.assertion.ViewAssertions.matches
5656
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
@@ -239,7 +239,7 @@ internal class LegacyWorkflowRenderingTest {
239239

240240
override fun onAttachedToWindow() {
241241
super.onAttachedToWindow()
242-
val lifecycle = ViewTreeLifecycleOwner.get(this)!!.lifecycle
242+
val lifecycle = this.findViewTreeLifecycleOwner()!!.lifecycle
243243
lifecycle.addObserver(
244244
LifecycleEventObserver { _, event ->
245245
lifecycleEvents += event
@@ -277,7 +277,8 @@ internal class LegacyWorkflowRenderingTest {
277277
val states = mutableListOf<State>()
278278
val parentOwner = object : LifecycleOwner {
279279
val registry = LifecycleRegistry(this)
280-
override fun getLifecycle(): Lifecycle = registry
280+
override val lifecycle: Lifecycle
281+
get() = registry
281282
}
282283

283284
composeRule.setContent {
@@ -319,7 +320,8 @@ internal class LegacyWorkflowRenderingTest {
319320
val states = mutableListOf<State>()
320321
val parentOwner = object : LifecycleOwner {
321322
val registry = LifecycleRegistry(this)
322-
override fun getLifecycle(): Lifecycle = registry
323+
override val lifecycle: Lifecycle
324+
get() = registry
323325
}
324326
composeRule.runOnIdle {
325327
// Cannot go directly to DESTROYED

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import androidx.lifecycle.Lifecycle.State.STARTED
4848
import androidx.lifecycle.LifecycleEventObserver
4949
import androidx.lifecycle.LifecycleOwner
5050
import androidx.lifecycle.LifecycleRegistry
51-
import androidx.lifecycle.ViewTreeLifecycleOwner
51+
import androidx.lifecycle.findViewTreeLifecycleOwner
5252
import androidx.test.espresso.Espresso.onView
5353
import androidx.test.espresso.assertion.ViewAssertions.matches
5454
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
@@ -236,7 +236,7 @@ internal class WorkflowRenderingTest {
236236
val view = object : View(context) {
237237
override fun onAttachedToWindow() {
238238
super.onAttachedToWindow()
239-
val lifecycle = ViewTreeLifecycleOwner.get(this)!!.lifecycle
239+
val lifecycle = this.findViewTreeLifecycleOwner()!!.lifecycle
240240
lifecycle.addObserver(
241241
LifecycleEventObserver { _, event -> lifecycleEvents += event }
242242
)
@@ -273,7 +273,8 @@ internal class WorkflowRenderingTest {
273273
val states = mutableListOf<State>()
274274
val parentOwner = object : LifecycleOwner {
275275
val registry = LifecycleRegistry(this)
276-
override fun getLifecycle(): Lifecycle = registry
276+
override val lifecycle: Lifecycle
277+
get() = registry
277278
}
278279

279280
composeRule.setContent {
@@ -315,7 +316,8 @@ internal class WorkflowRenderingTest {
315316
val states = mutableListOf<State>()
316317
val parentOwner = object : LifecycleOwner {
317318
val registry = LifecycleRegistry(this)
318-
override fun getLifecycle(): Lifecycle = registry
319+
override val lifecycle: Lifecycle
320+
get() = registry
319321
}
320322
composeRule.runOnIdle {
321323
// Cannot go directly to DESTROYED
@@ -533,7 +535,6 @@ internal class WorkflowRenderingTest {
533535
}
534536
}
535537

536-
@Suppress("UNCHECKED_CAST")
537538
private interface ComposableRendering<RenderingT : ComposableRendering<RenderingT>> :
538539
AndroidScreen<RenderingT> {
539540

workflow-ui/compose/src/main/java/com/squareup/workflow1/ui/compose/LegacyWorkflowRendering.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import androidx.lifecycle.Lifecycle.State.INITIALIZED
1818
import androidx.lifecycle.LifecycleEventObserver
1919
import androidx.lifecycle.LifecycleOwner
2020
import androidx.lifecycle.LifecycleRegistry
21-
import androidx.lifecycle.ViewTreeLifecycleOwner
21+
import androidx.lifecycle.setViewTreeLifecycleOwner
2222
import com.squareup.workflow1.ui.Compatible
2323
import com.squareup.workflow1.ui.ViewEnvironment
2424
import com.squareup.workflow1.ui.ViewFactory
@@ -90,7 +90,8 @@ public fun WorkflowRendering(
9090
val lifecycleOwner = remember {
9191
object : LifecycleOwner {
9292
val registry = LifecycleRegistry(this)
93-
override fun getLifecycle(): Lifecycle = registry
93+
override val lifecycle: Lifecycle
94+
get() = registry
9495
}
9596
}
9697
val parentLifecycle = LocalLifecycleOwner.current.lifecycle
@@ -107,7 +108,7 @@ public fun WorkflowRendering(
107108

108109
// If we're leaving the composition it means the WorkflowRendering is either going away itself
109110
// or about to switch to an incompatible rendering – either way, this lifecycle is dead. Note
110-
// that we can't transition from INITIALIZED to DESTROYED – the LifecycelRegistry will throw.
111+
// that we can't transition from INITIALIZED to DESTROYED – the LifecycleRegistry will throw.
111112
// WorkflowLifecycleOwner has this same check.
112113
if (lifecycleOwner.registry.currentState != INITIALIZED) {
113114
lifecycleOwner.registry.currentState = DESTROYED
@@ -168,7 +169,7 @@ private fun <R : Any> ViewFactory<R>.asComposeViewFactory() =
168169
}
169170

170171
// Unfortunately AndroidView doesn't propagate this itself.
171-
ViewTreeLifecycleOwner.set(view, lifecycleOwner)
172+
view.setViewTreeLifecycleOwner(lifecycleOwner)
172173
// We don't propagate the (non-compose) SavedStateRegistryOwner, or the (compose)
173174
// SaveableStateRegistry, because currently all our navigation is implemented as
174175
// Android views, which ensures there is always an Android view between any state

workflow-ui/compose/src/main/java/com/squareup/workflow1/ui/compose/WorkflowRendering.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import androidx.lifecycle.Lifecycle.State.INITIALIZED
2121
import androidx.lifecycle.LifecycleEventObserver
2222
import androidx.lifecycle.LifecycleOwner
2323
import androidx.lifecycle.LifecycleRegistry
24-
import androidx.lifecycle.ViewTreeLifecycleOwner
24+
import androidx.lifecycle.setViewTreeLifecycleOwner
2525
import com.squareup.workflow1.ui.Compatible
2626
import com.squareup.workflow1.ui.OnBackPressedDispatcherOwnerKey
2727
import com.squareup.workflow1.ui.Screen
@@ -123,7 +123,8 @@ public fun WorkflowRendering(
123123
val lifecycleOwner = remember {
124124
object : LifecycleOwner {
125125
val registry = LifecycleRegistry(this)
126-
override fun getLifecycle(): Lifecycle = registry
126+
override val lifecycle: Lifecycle
127+
get() = registry
127128
}
128129
}
129130
val parentLifecycle = LocalLifecycleOwner.current.lifecycle
@@ -213,7 +214,7 @@ private fun <ScreenT : Screen> ScreenViewFactory<ScreenT>.asComposeViewFactory()
213214
viewHolder.view.setTag(R.id.workflow_screen_view_holder, viewHolder)
214215

215216
// Unfortunately AndroidView doesn't propagate these itself.
216-
ViewTreeLifecycleOwner.set(viewHolder.view, lifecycleOwner)
217+
viewHolder.view.setViewTreeLifecycleOwner(lifecycleOwner)
217218
onBackOrNull?.let {
218219
viewHolder.view.setViewTreeOnBackPressedDispatcherOwner(it)
219220
}

workflow-ui/container-android/dependencies/releaseRuntimeClasspath.txt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
androidx.activity:activity:1.6.1
22
androidx.annotation:annotation-experimental:1.3.0
3-
androidx.annotation:annotation:1.3.0
3+
androidx.annotation:annotation-jvm:1.6.0
4+
androidx.annotation:annotation:1.6.0
45
androidx.appcompat:appcompat-resources:1.6.1
56
androidx.appcompat:appcompat:1.6.1
6-
androidx.arch.core:core-common:2.1.0
7-
androidx.arch.core:core-runtime:2.1.0
7+
androidx.arch.core:core-common:2.2.0
8+
androidx.arch.core:core-runtime:2.2.0
89
androidx.collection:collection:1.1.0
9-
androidx.concurrent:concurrent-futures:1.0.0
10-
androidx.core:core-ktx:1.9.0
11-
androidx.core:core:1.9.0
10+
androidx.concurrent:concurrent-futures:1.1.0
11+
androidx.core:core-ktx:1.10.0
12+
androidx.core:core:1.10.0
1213
androidx.cursoradapter:cursoradapter:1.0.0
1314
androidx.customview:customview:1.0.0
1415
androidx.drawerlayout:drawerlayout:1.0.0
1516
androidx.emoji2:emoji2-views-helper:1.2.0
1617
androidx.emoji2:emoji2:1.2.0
1718
androidx.fragment:fragment:1.3.6
1819
androidx.interpolator:interpolator:1.0.0
19-
androidx.lifecycle:lifecycle-common:2.5.1
20-
androidx.lifecycle:lifecycle-livedata-core:2.5.1
21-
androidx.lifecycle:lifecycle-livedata:2.5.1
22-
androidx.lifecycle:lifecycle-process:2.5.1
23-
androidx.lifecycle:lifecycle-runtime-ktx:2.5.1
24-
androidx.lifecycle:lifecycle-runtime:2.5.1
25-
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1
26-
androidx.lifecycle:lifecycle-viewmodel:2.5.1
20+
androidx.lifecycle:lifecycle-common:2.6.1
21+
androidx.lifecycle:lifecycle-livedata-core:2.6.1
22+
androidx.lifecycle:lifecycle-livedata:2.6.1
23+
androidx.lifecycle:lifecycle-process:2.6.1
24+
androidx.lifecycle:lifecycle-runtime-ktx:2.6.1
25+
androidx.lifecycle:lifecycle-runtime:2.6.1
26+
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1
27+
androidx.lifecycle:lifecycle-viewmodel:2.6.1
2728
androidx.loader:loader:1.0.0
29+
androidx.profileinstaller:profileinstaller:1.3.0
2830
androidx.resourceinspection:resourceinspection-annotation:1.0.1
2931
androidx.savedstate:savedstate:1.2.1
3032
androidx.startup:startup-runtime:1.1.1

workflow-ui/core-android/dependencies/releaseRuntimeClasspath.txt

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
androidx.activity:activity:1.6.1
2-
androidx.annotation:annotation-experimental:1.1.0
3-
androidx.annotation:annotation:1.2.0
4-
androidx.arch.core:core-common:2.1.0
5-
androidx.arch.core:core-runtime:2.1.0
2+
androidx.annotation:annotation-experimental:1.3.0
3+
androidx.annotation:annotation-jvm:1.6.0
4+
androidx.annotation:annotation:1.6.0
5+
androidx.arch.core:core-common:2.2.0
6+
androidx.arch.core:core-runtime:2.2.0
67
androidx.collection:collection:1.1.0
7-
androidx.concurrent:concurrent-futures:1.0.0
8-
androidx.core:core-ktx:1.6.0
9-
androidx.core:core:1.8.0
10-
androidx.lifecycle:lifecycle-common:2.5.1
11-
androidx.lifecycle:lifecycle-livedata-core:2.5.1
12-
androidx.lifecycle:lifecycle-runtime-ktx:2.5.1
13-
androidx.lifecycle:lifecycle-runtime:2.5.1
14-
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1
15-
androidx.lifecycle:lifecycle-viewmodel:2.5.1
8+
androidx.concurrent:concurrent-futures:1.1.0
9+
androidx.core:core-ktx:1.10.0
10+
androidx.core:core:1.10.0
11+
androidx.interpolator:interpolator:1.0.0
12+
androidx.lifecycle:lifecycle-common:2.6.1
13+
androidx.lifecycle:lifecycle-livedata-core:2.6.1
14+
androidx.lifecycle:lifecycle-runtime-ktx:2.6.1
15+
androidx.lifecycle:lifecycle-runtime:2.6.1
16+
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1
17+
androidx.lifecycle:lifecycle-viewmodel:2.6.1
18+
androidx.profileinstaller:profileinstaller:1.3.0
1619
androidx.savedstate:savedstate:1.2.1
20+
androidx.startup:startup-runtime:1.1.1
1721
androidx.tracing:tracing:1.0.0
1822
androidx.transition:transition:1.4.1
1923
androidx.versionedparcelable:versionedparcelable:1.1.1

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import android.view.ViewGroup
77
import androidx.activity.ComponentActivity
88
import androidx.activity.OnBackPressedCallback
99
import androidx.activity.OnBackPressedDispatcherSpy
10+
import androidx.lifecycle.Lifecycle
1011
import androidx.lifecycle.Lifecycle.State.DESTROYED
1112
import androidx.lifecycle.Lifecycle.State.RESUMED
13+
import androidx.lifecycle.LifecycleOwner
1214
import androidx.lifecycle.LifecycleRegistry
13-
import androidx.lifecycle.ViewTreeLifecycleOwner
15+
import androidx.lifecycle.setViewTreeLifecycleOwner
1416
import androidx.test.ext.junit.rules.ActivityScenarioRule
1517
import com.google.common.truth.Truth.assertThat
1618
import com.squareup.workflow1.ui.internal.test.IdlingDispatcherRule
@@ -106,7 +108,11 @@ internal class BackPressedHandlerTest {
106108
view.backPressedHandler = viewBackHandler
107109
assertThat(spy.callbacks()).hasSize(1)
108110

109-
ViewTreeLifecycleOwner.set(view) { lifecycle }
111+
val lifecycleOwner = object : LifecycleOwner {
112+
override val lifecycle: Lifecycle
113+
get() = lifecycle
114+
}
115+
view.setViewTreeLifecycleOwner(lifecycleOwner)
110116
activity.setContentView(view)
111117

112118
(view.parent as ViewGroup).removeView(view)

0 commit comments

Comments
 (0)