Skip to content

Commit

Permalink
Merge pull request #1090 from square/sedwards/update-deps
Browse files Browse the repository at this point in the history
Update AndroidX Dependencies
  • Loading branch information
steve-the-edwards authored Jul 17, 2023
2 parents 6697056 + 638c209 commit 9a5bd11
Show file tree
Hide file tree
Showing 26 changed files with 173 additions and 143 deletions.
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ androidx-compose-compiler = "1.4.4"
# see https://developer.android.com/jetpack/compose/bom/bom-mapping
androidx-compose-bom = "2023.01.00"
androidx-constraintlayout = "2.1.4"
androidx-core = "1.6.0"
androidx-core = "1.10.0"
androidx-fragment = "1.3.6"
androidx-gridlayout = "1.0.0"
androidx-lifecycle = "2.5.1"
androidx-lifecycle = "2.6.1"
androidx-navigation = "2.4.0-alpha09"
androidx-paging = "3.0.1"
androidx-profileinstaller = "1.2.0-alpha02"
Expand All @@ -33,7 +33,7 @@ androidx-test-truth-ext = "1.5.0"
androidx-tracing = "1.1.0"
androidx-transition = "1.4.1"
androidx-viewbinding = "4.2.1"
androidx-work = "2.6.0"
androidx-work = "2.7.0"

detekt = "1.19.0"
dokka = "1.8.20"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
androidx.activity:activity-compose:1.6.1
androidx.activity:activity-ktx:1.6.1
androidx.activity:activity:1.6.1
androidx.annotation:annotation-experimental:1.1.0
androidx.annotation:annotation:1.5.0
androidx.arch.core:core-common:2.1.0
androidx.arch.core:core-runtime:2.1.0
androidx.annotation:annotation-experimental:1.3.0
androidx.annotation:annotation-jvm:1.6.0
androidx.annotation:annotation:1.6.0
androidx.arch.core:core-common:2.2.0
androidx.arch.core:core-runtime:2.2.0
androidx.autofill:autofill:1.0.0
androidx.collection:collection:1.1.0
androidx.compose.animation:animation-core:1.3.3
Expand All @@ -21,19 +22,20 @@ androidx.compose.ui:ui-unit:1.3.3
androidx.compose.ui:ui-util:1.3.3
androidx.compose.ui:ui:1.3.3
androidx.compose:compose-bom:2023.01.00
androidx.concurrent:concurrent-futures:1.0.0
androidx.core:core-ktx:1.6.0
androidx.core:core:1.8.0
androidx.concurrent:concurrent-futures:1.1.0
androidx.core:core-ktx:1.10.0
androidx.core:core:1.10.0
androidx.customview:customview-poolingcontainer:1.0.0
androidx.lifecycle:lifecycle-common-java8:2.5.1
androidx.lifecycle:lifecycle-common:2.5.1
androidx.lifecycle:lifecycle-livedata-core:2.5.1
androidx.lifecycle:lifecycle-runtime-ktx:2.5.1
androidx.lifecycle:lifecycle-runtime:2.5.1
androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1
androidx.lifecycle:lifecycle-viewmodel:2.5.1
androidx.profileinstaller:profileinstaller:1.2.0
androidx.interpolator:interpolator:1.0.0
androidx.lifecycle:lifecycle-common-java8:2.6.1
androidx.lifecycle:lifecycle-common:2.6.1
androidx.lifecycle:lifecycle-livedata-core:2.6.1
androidx.lifecycle:lifecycle-runtime-ktx:2.6.1
androidx.lifecycle:lifecycle-runtime:2.6.1
androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1
androidx.lifecycle:lifecycle-viewmodel:2.6.1
androidx.profileinstaller:profileinstaller:1.3.0
androidx.savedstate:savedstate-ktx:1.2.1
androidx.savedstate:savedstate:1.2.1
androidx.startup:startup-runtime:1.1.1
Expand Down
34 changes: 18 additions & 16 deletions workflow-ui/compose/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
androidx.activity:activity-compose:1.6.1
androidx.activity:activity-ktx:1.6.1
androidx.activity:activity:1.6.1
androidx.annotation:annotation-experimental:1.1.0
androidx.annotation:annotation:1.5.0
androidx.arch.core:core-common:2.1.0
androidx.arch.core:core-runtime:2.1.0
androidx.annotation:annotation-experimental:1.3.0
androidx.annotation:annotation-jvm:1.6.0
androidx.annotation:annotation:1.6.0
androidx.arch.core:core-common:2.2.0
androidx.arch.core:core-runtime:2.2.0
androidx.autofill:autofill:1.0.0
androidx.collection:collection:1.1.0
androidx.compose.animation:animation-core:1.3.3
Expand All @@ -18,19 +19,20 @@ androidx.compose.ui:ui-unit:1.3.3
androidx.compose.ui:ui-util:1.3.3
androidx.compose.ui:ui:1.3.3
androidx.compose:compose-bom:2023.01.00
androidx.concurrent:concurrent-futures:1.0.0
androidx.core:core-ktx:1.6.0
androidx.core:core:1.8.0
androidx.concurrent:concurrent-futures:1.1.0
androidx.core:core-ktx:1.10.0
androidx.core:core:1.10.0
androidx.customview:customview-poolingcontainer:1.0.0
androidx.lifecycle:lifecycle-common-java8:2.5.1
androidx.lifecycle:lifecycle-common:2.5.1
androidx.lifecycle:lifecycle-livedata-core:2.5.1
androidx.lifecycle:lifecycle-runtime-ktx:2.5.1
androidx.lifecycle:lifecycle-runtime:2.5.1
androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1
androidx.lifecycle:lifecycle-viewmodel:2.5.1
androidx.profileinstaller:profileinstaller:1.2.0
androidx.interpolator:interpolator:1.0.0
androidx.lifecycle:lifecycle-common-java8:2.6.1
androidx.lifecycle:lifecycle-common:2.6.1
androidx.lifecycle:lifecycle-livedata-core:2.6.1
androidx.lifecycle:lifecycle-runtime-ktx:2.6.1
androidx.lifecycle:lifecycle-runtime:2.6.1
androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1
androidx.lifecycle:lifecycle-viewmodel:2.6.1
androidx.profileinstaller:profileinstaller:1.3.0
androidx.savedstate:savedstate-ktx:1.2.1
androidx.savedstate:savedstate:1.2.1
androidx.startup:startup-runtime:1.1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import androidx.lifecycle.Lifecycle.State.STARTED
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleRegistry
import androidx.lifecycle.ViewTreeLifecycleOwner
import androidx.lifecycle.findViewTreeLifecycleOwner
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
Expand Down Expand Up @@ -239,7 +239,7 @@ internal class LegacyWorkflowRenderingTest {

override fun onAttachedToWindow() {
super.onAttachedToWindow()
val lifecycle = ViewTreeLifecycleOwner.get(this)!!.lifecycle
val lifecycle = this.findViewTreeLifecycleOwner()!!.lifecycle
lifecycle.addObserver(
LifecycleEventObserver { _, event ->
lifecycleEvents += event
Expand Down Expand Up @@ -277,7 +277,8 @@ internal class LegacyWorkflowRenderingTest {
val states = mutableListOf<State>()
val parentOwner = object : LifecycleOwner {
val registry = LifecycleRegistry(this)
override fun getLifecycle(): Lifecycle = registry
override val lifecycle: Lifecycle
get() = registry
}

composeRule.setContent {
Expand Down Expand Up @@ -319,7 +320,8 @@ internal class LegacyWorkflowRenderingTest {
val states = mutableListOf<State>()
val parentOwner = object : LifecycleOwner {
val registry = LifecycleRegistry(this)
override fun getLifecycle(): Lifecycle = registry
override val lifecycle: Lifecycle
get() = registry
}
composeRule.runOnIdle {
// Cannot go directly to DESTROYED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import androidx.lifecycle.Lifecycle.State.STARTED
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleRegistry
import androidx.lifecycle.ViewTreeLifecycleOwner
import androidx.lifecycle.findViewTreeLifecycleOwner
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
Expand Down Expand Up @@ -236,7 +236,7 @@ internal class WorkflowRenderingTest {
val view = object : View(context) {
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val lifecycle = ViewTreeLifecycleOwner.get(this)!!.lifecycle
val lifecycle = this.findViewTreeLifecycleOwner()!!.lifecycle
lifecycle.addObserver(
LifecycleEventObserver { _, event -> lifecycleEvents += event }
)
Expand Down Expand Up @@ -273,7 +273,8 @@ internal class WorkflowRenderingTest {
val states = mutableListOf<State>()
val parentOwner = object : LifecycleOwner {
val registry = LifecycleRegistry(this)
override fun getLifecycle(): Lifecycle = registry
override val lifecycle: Lifecycle
get() = registry
}

composeRule.setContent {
Expand Down Expand Up @@ -315,7 +316,8 @@ internal class WorkflowRenderingTest {
val states = mutableListOf<State>()
val parentOwner = object : LifecycleOwner {
val registry = LifecycleRegistry(this)
override fun getLifecycle(): Lifecycle = registry
override val lifecycle: Lifecycle
get() = registry
}
composeRule.runOnIdle {
// Cannot go directly to DESTROYED
Expand Down Expand Up @@ -533,7 +535,6 @@ internal class WorkflowRenderingTest {
}
}

@Suppress("UNCHECKED_CAST")
private interface ComposableRendering<RenderingT : ComposableRendering<RenderingT>> :
AndroidScreen<RenderingT> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import androidx.lifecycle.Lifecycle.State.INITIALIZED
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleRegistry
import androidx.lifecycle.ViewTreeLifecycleOwner
import androidx.lifecycle.setViewTreeLifecycleOwner
import com.squareup.workflow1.ui.Compatible
import com.squareup.workflow1.ui.ViewEnvironment
import com.squareup.workflow1.ui.ViewFactory
Expand Down Expand Up @@ -90,7 +90,8 @@ public fun WorkflowRendering(
val lifecycleOwner = remember {
object : LifecycleOwner {
val registry = LifecycleRegistry(this)
override fun getLifecycle(): Lifecycle = registry
override val lifecycle: Lifecycle
get() = registry
}
}
val parentLifecycle = LocalLifecycleOwner.current.lifecycle
Expand All @@ -107,7 +108,7 @@ public fun WorkflowRendering(

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

// Unfortunately AndroidView doesn't propagate this itself.
ViewTreeLifecycleOwner.set(view, lifecycleOwner)
view.setViewTreeLifecycleOwner(lifecycleOwner)
// We don't propagate the (non-compose) SavedStateRegistryOwner, or the (compose)
// SaveableStateRegistry, because currently all our navigation is implemented as
// Android views, which ensures there is always an Android view between any state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.lifecycle.Lifecycle.State.INITIALIZED
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleRegistry
import androidx.lifecycle.ViewTreeLifecycleOwner
import androidx.lifecycle.setViewTreeLifecycleOwner
import com.squareup.workflow1.ui.Compatible
import com.squareup.workflow1.ui.OnBackPressedDispatcherOwnerKey
import com.squareup.workflow1.ui.Screen
Expand Down Expand Up @@ -123,7 +123,8 @@ public fun WorkflowRendering(
val lifecycleOwner = remember {
object : LifecycleOwner {
val registry = LifecycleRegistry(this)
override fun getLifecycle(): Lifecycle = registry
override val lifecycle: Lifecycle
get() = registry
}
}
val parentLifecycle = LocalLifecycleOwner.current.lifecycle
Expand Down Expand Up @@ -213,7 +214,7 @@ private fun <ScreenT : Screen> ScreenViewFactory<ScreenT>.asComposeViewFactory()
viewHolder.view.setTag(R.id.workflow_screen_view_holder, viewHolder)

// Unfortunately AndroidView doesn't propagate these itself.
ViewTreeLifecycleOwner.set(viewHolder.view, lifecycleOwner)
viewHolder.view.setViewTreeLifecycleOwner(lifecycleOwner)
onBackOrNull?.let {
viewHolder.view.setViewTreeOnBackPressedDispatcherOwner(it)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
androidx.activity:activity:1.6.1
androidx.annotation:annotation-experimental:1.3.0
androidx.annotation:annotation:1.3.0
androidx.annotation:annotation-jvm:1.6.0
androidx.annotation:annotation:1.6.0
androidx.appcompat:appcompat-resources:1.6.1
androidx.appcompat:appcompat:1.6.1
androidx.arch.core:core-common:2.1.0
androidx.arch.core:core-runtime:2.1.0
androidx.arch.core:core-common:2.2.0
androidx.arch.core:core-runtime:2.2.0
androidx.collection:collection:1.1.0
androidx.concurrent:concurrent-futures:1.0.0
androidx.core:core-ktx:1.9.0
androidx.core:core:1.9.0
androidx.concurrent:concurrent-futures:1.1.0
androidx.core:core-ktx:1.10.0
androidx.core:core:1.10.0
androidx.cursoradapter:cursoradapter:1.0.0
androidx.customview:customview:1.0.0
androidx.drawerlayout:drawerlayout:1.0.0
androidx.emoji2:emoji2-views-helper:1.2.0
androidx.emoji2:emoji2:1.2.0
androidx.fragment:fragment:1.3.6
androidx.interpolator:interpolator:1.0.0
androidx.lifecycle:lifecycle-common:2.5.1
androidx.lifecycle:lifecycle-livedata-core:2.5.1
androidx.lifecycle:lifecycle-livedata:2.5.1
androidx.lifecycle:lifecycle-process:2.5.1
androidx.lifecycle:lifecycle-runtime-ktx:2.5.1
androidx.lifecycle:lifecycle-runtime:2.5.1
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1
androidx.lifecycle:lifecycle-viewmodel:2.5.1
androidx.lifecycle:lifecycle-common:2.6.1
androidx.lifecycle:lifecycle-livedata-core:2.6.1
androidx.lifecycle:lifecycle-livedata:2.6.1
androidx.lifecycle:lifecycle-process:2.6.1
androidx.lifecycle:lifecycle-runtime-ktx:2.6.1
androidx.lifecycle:lifecycle-runtime:2.6.1
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1
androidx.lifecycle:lifecycle-viewmodel:2.6.1
androidx.loader:loader:1.0.0
androidx.profileinstaller:profileinstaller:1.3.0
androidx.resourceinspection:resourceinspection-annotation:1.0.1
androidx.savedstate:savedstate:1.2.1
androidx.startup:startup-runtime:1.1.1
Expand Down
30 changes: 17 additions & 13 deletions workflow-ui/core-android/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
androidx.activity:activity:1.6.1
androidx.annotation:annotation-experimental:1.1.0
androidx.annotation:annotation:1.2.0
androidx.arch.core:core-common:2.1.0
androidx.arch.core:core-runtime:2.1.0
androidx.annotation:annotation-experimental:1.3.0
androidx.annotation:annotation-jvm:1.6.0
androidx.annotation:annotation:1.6.0
androidx.arch.core:core-common:2.2.0
androidx.arch.core:core-runtime:2.2.0
androidx.collection:collection:1.1.0
androidx.concurrent:concurrent-futures:1.0.0
androidx.core:core-ktx:1.6.0
androidx.core:core:1.8.0
androidx.lifecycle:lifecycle-common:2.5.1
androidx.lifecycle:lifecycle-livedata-core:2.5.1
androidx.lifecycle:lifecycle-runtime-ktx:2.5.1
androidx.lifecycle:lifecycle-runtime:2.5.1
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1
androidx.lifecycle:lifecycle-viewmodel:2.5.1
androidx.concurrent:concurrent-futures:1.1.0
androidx.core:core-ktx:1.10.0
androidx.core:core:1.10.0
androidx.interpolator:interpolator:1.0.0
androidx.lifecycle:lifecycle-common:2.6.1
androidx.lifecycle:lifecycle-livedata-core:2.6.1
androidx.lifecycle:lifecycle-runtime-ktx:2.6.1
androidx.lifecycle:lifecycle-runtime:2.6.1
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1
androidx.lifecycle:lifecycle-viewmodel:2.6.1
androidx.profileinstaller:profileinstaller:1.3.0
androidx.savedstate:savedstate:1.2.1
androidx.startup:startup-runtime:1.1.1
androidx.tracing:tracing:1.0.0
androidx.transition:transition:1.4.1
androidx.versionedparcelable:versionedparcelable:1.1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import android.view.ViewGroup
import androidx.activity.ComponentActivity
import androidx.activity.OnBackPressedCallback
import androidx.activity.OnBackPressedDispatcherSpy
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.Lifecycle.State.DESTROYED
import androidx.lifecycle.Lifecycle.State.RESUMED
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleRegistry
import androidx.lifecycle.ViewTreeLifecycleOwner
import androidx.lifecycle.setViewTreeLifecycleOwner
import androidx.test.ext.junit.rules.ActivityScenarioRule
import com.google.common.truth.Truth.assertThat
import com.squareup.workflow1.ui.internal.test.IdlingDispatcherRule
Expand Down Expand Up @@ -106,7 +108,11 @@ internal class BackPressedHandlerTest {
view.backPressedHandler = viewBackHandler
assertThat(spy.callbacks()).hasSize(1)

ViewTreeLifecycleOwner.set(view) { lifecycle }
val lifecycleOwner = object : LifecycleOwner {
override val lifecycle: Lifecycle
get() = lifecycle
}
view.setViewTreeLifecycleOwner(lifecycleOwner)
activity.setContentView(view)

(view.parent as ViewGroup).removeView(view)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ internal class WorkflowViewStubLifecycleTest {
override val savedStateRegistry: SavedStateRegistry
get() = controller.savedStateRegistry

override fun getLifecycle(): Lifecycle = lifecycleRegistry
override val lifecycle: Lifecycle
get() = lifecycleRegistry
}

data class RegistrySetter(val wrapped: TestRendering) : ViewRendering<RegistrySetter>() {
Expand Down
Loading

0 comments on commit 9a5bd11

Please sign in to comment.