Skip to content

Commit 127d456

Browse files
committed
Reverts ComposeView ViewCompositionStrategy to default.
This was the first attempt to fix dead `ComposeView` instances in shuffled `Dialog` windows, but it breaks other things. Still seems like the right thing to do, but maybe that ship has sailed. If the need comes up again, consider adding a `ViewEnvironment` property to allow customizing it (yuck). Undoes #1213
1 parent c7cd119 commit 127d456

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import androidx.compose.runtime.CompositionLocalProvider
1010
import androidx.compose.runtime.remember
1111
import androidx.compose.ui.platform.ComposeView
1212
import androidx.compose.ui.platform.LocalLifecycleOwner
13-
import androidx.compose.ui.platform.ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed
1413
import androidx.compose.ui.viewinterop.AndroidView
1514
import androidx.lifecycle.setViewTreeLifecycleOwner
1615
import com.squareup.workflow1.ui.Screen
@@ -126,7 +125,6 @@ public fun <ScreenT : Screen> ScreenComposableFactory<ScreenT>.asViewFactory():
126125
container: ViewGroup?
127126
): ScreenViewHolder<ScreenT> {
128127
val view = ComposeView(context)
129-
view.setViewCompositionStrategy(DisposeOnViewTreeLifecycleDestroyed)
130128
return ScreenViewHolder(initialEnvironment, view) { newRendering, environment ->
131129

132130
// Update the state whenever a new rendering is emitted.

0 commit comments

Comments
 (0)