Skip to content

Commit d92849f

Browse files
Merge pull request #1243 from square/sedwards/cleanup-imports
Remove unnecessary fully qualified LocalLifecycleOwner use
2 parents 74635d9 + a18bfe5 commit d92849f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class ComposeLifecycleOwnerTest {
5757
childLifecycleOwner = rememberChildLifecycleOwner(parentLifecycle)
5858
parentLifecycle.currentState = CREATED
5959
CompositionLocalProvider(
60-
androidx.lifecycle.compose.LocalLifecycleOwner provides childLifecycleOwner
60+
LocalLifecycleOwner provides childLifecycleOwner
6161
) {
6262
// let's assert right away as things are composing, because we want to ensure that
6363
// the lifecycle is in the correct state as soon as possible & not just after composition
@@ -91,9 +91,9 @@ class ComposeLifecycleOwnerTest {
9191
LaunchedEffect(Unit) { seenRecomposition = true }
9292
CompositionLocalProvider(
9393
if (seenRecomposition) {
94-
androidx.lifecycle.compose.LocalLifecycleOwner provides customParentLifecycleOwner
94+
LocalLifecycleOwner provides customParentLifecycleOwner
9595
} else {
96-
androidx.lifecycle.compose.LocalLifecycleOwner provides androidx.lifecycle.compose.LocalLifecycleOwner.current
96+
LocalLifecycleOwner provides LocalLifecycleOwner.current
9797
}
9898
) {
9999

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +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.compose.LocalLifecycleOwner
5152
import androidx.lifecycle.findViewTreeLifecycleOwner
5253
import androidx.test.espresso.Espresso.onView
5354
import androidx.test.espresso.assertion.ViewAssertions.matches
@@ -213,7 +214,7 @@ internal class WorkflowRenderingTest {
213214

214215
class LifecycleRecorder : ComposableRendering {
215216
@Composable override fun Content() {
216-
val lifecycle = androidx.lifecycle.compose.LocalLifecycleOwner.current.lifecycle
217+
val lifecycle = LocalLifecycleOwner.current.lifecycle
217218
DisposableEffect(lifecycle) {
218219
lifecycle.addObserver(
219220
LifecycleEventObserver { _, event ->
@@ -301,7 +302,7 @@ internal class WorkflowRenderingTest {
301302

302303
composeRule.setContent {
303304
CompositionLocalProvider(
304-
androidx.lifecycle.compose.LocalLifecycleOwner provides parentOwner
305+
LocalLifecycleOwner provides parentOwner
305306
) {
306307
env.RootScreen(LifecycleRecorder(states))
307308
}
@@ -351,7 +352,7 @@ internal class WorkflowRenderingTest {
351352

352353
composeRule.setContent {
353354
CompositionLocalProvider(
354-
androidx.lifecycle.compose.LocalLifecycleOwner provides parentOwner
355+
LocalLifecycleOwner provides parentOwner
355356
) {
356357
env.RootScreen(LifecycleRecorder(states))
357358
}
@@ -542,7 +543,7 @@ internal class WorkflowRenderingTest {
542543
private val states: MutableList<State>
543544
) : ComposableRendering {
544545
@Composable override fun Content() {
545-
val lifecycle = androidx.lifecycle.compose.LocalLifecycleOwner.current.lifecycle
546+
val lifecycle = LocalLifecycleOwner.current.lifecycle
546547
DisposableEffect(lifecycle) {
547548
this@LifecycleRecorder.states += lifecycle.currentState
548549
lifecycle.addObserver(

0 commit comments

Comments
 (0)