diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index ecdf40e4..168e362d 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -19,8 +19,8 @@ import java.util.Locale.US import kotlin.reflect.full.declaredMembers object Versions { - const val compose = "1.0.0-alpha07" - const val kotlin = "1.4.10" + const val compose = "1.0.0-alpha09" + const val kotlin = "1.4.21" // This *is* actually used. @Suppress("unused") @@ -42,8 +42,8 @@ object Dependencies { const val material = "androidx.compose.material:material:${Versions.compose}" const val savedstate = "androidx.compose.runtime:runtime-saved-instance-state:${Versions.compose}" - const val test = "androidx.ui:ui-test:${Versions.compose}" - const val tooling = "androidx.ui:ui-tooling:${Versions.compose}" + const val test = "androidx.compose.ui:ui-test-junit4:${Versions.compose}" + const val tooling = "androidx.compose.ui:ui-tooling:${Versions.compose}" } const val timber = "com.jakewharton.timber:timber:4.7.1" diff --git a/compose-tooling/src/androidTest/java/com/squareup/workflow/ui/compose/tooling/PreviewComposeWorkflowTest.kt b/compose-tooling/src/androidTest/java/com/squareup/workflow/ui/compose/tooling/PreviewComposeWorkflowTest.kt index 84b38af7..e7590b6f 100644 --- a/compose-tooling/src/androidTest/java/com/squareup/workflow/ui/compose/tooling/PreviewComposeWorkflowTest.kt +++ b/compose-tooling/src/androidTest/java/com/squareup/workflow/ui/compose/tooling/PreviewComposeWorkflowTest.kt @@ -27,8 +27,8 @@ import androidx.compose.ui.test.assertIsNotDisplayed import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.unit.dp import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.ui.test.createComposeRule -import androidx.ui.tooling.preview.Preview +import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.tooling.preview.Preview import com.squareup.workflow.Workflow import com.squareup.workflow.ui.ViewEnvironmentKey import com.squareup.workflow.ui.compose.WorkflowRendering diff --git a/compose-tooling/src/androidTest/java/com/squareup/workflow/ui/compose/tooling/PreviewViewFactoryTest.kt b/compose-tooling/src/androidTest/java/com/squareup/workflow/ui/compose/tooling/PreviewViewFactoryTest.kt index de471822..5d1a8a8f 100644 --- a/compose-tooling/src/androidTest/java/com/squareup/workflow/ui/compose/tooling/PreviewViewFactoryTest.kt +++ b/compose-tooling/src/androidTest/java/com/squareup/workflow/ui/compose/tooling/PreviewViewFactoryTest.kt @@ -27,8 +27,8 @@ import androidx.compose.ui.test.assertIsNotDisplayed import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.unit.dp import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.ui.test.createComposeRule -import androidx.ui.tooling.preview.Preview +import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.tooling.preview.Preview import com.squareup.workflow.ui.ViewEnvironmentKey import com.squareup.workflow.ui.compose.WorkflowRendering import com.squareup.workflow.ui.compose.composedViewFactory diff --git a/compose-tooling/src/main/java/com/squareup/workflow/ui/compose/tooling/PlaceholderViewFactory.kt b/compose-tooling/src/main/java/com/squareup/workflow/ui/compose/tooling/PlaceholderViewFactory.kt index 56235860..02864364 100644 --- a/compose-tooling/src/main/java/com/squareup/workflow/ui/compose/tooling/PlaceholderViewFactory.kt +++ b/compose-tooling/src/main/java/com/squareup/workflow/ui/compose/tooling/PlaceholderViewFactory.kt @@ -18,7 +18,7 @@ package com.squareup.workflow.ui.compose.tooling import androidx.compose.foundation.background -import androidx.compose.foundation.drawBorder +import androidx.compose.foundation.border import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.text.BasicText @@ -37,9 +37,9 @@ import androidx.compose.ui.graphics.drawscope.rotate import androidx.compose.ui.graphics.withSaveLayer import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp -import androidx.ui.tooling.preview.Preview import com.squareup.workflow.ui.ViewFactory import com.squareup.workflow.ui.compose.composedViewFactory @@ -92,7 +92,7 @@ internal fun placeholderViewFactory(modifier: Modifier): ViewFactory = placeholderViewFactory(Modifier).preview( rendering = "preview", placeholderModifier = Modifier.fillMaxSize() - .drawBorder(size = 1.dp, color = Color.Red) + .border(width = 1.dp, color = Color.Red) ) } diff --git a/core-compose/api/core-compose.api b/core-compose/api/core-compose.api index 3ab1ac14..866df22f 100644 --- a/core-compose/api/core-compose.api +++ b/core-compose/api/core-compose.api @@ -1,7 +1,6 @@ public final class com/squareup/workflow/ui/compose/ComposeRendering { public static final field $stable I public static final field Companion Lcom/squareup/workflow/ui/compose/ComposeRendering$Companion; - public fun (Lkotlin/jvm/functions/Function3;)V } public final class com/squareup/workflow/ui/compose/ComposeRendering$Companion { diff --git a/core-compose/build.gradle.kts b/core-compose/build.gradle.kts index ceb6d7c4..d60f4adf 100644 --- a/core-compose/build.gradle.kts +++ b/core-compose/build.gradle.kts @@ -36,4 +36,6 @@ dependencies { implementation(Dependencies.Compose.layout) implementation(Dependencies.Compose.savedstate) implementation(Dependencies.Workflow.runtime) + + androidTestImplementation(Dependencies.Compose.test) } diff --git a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/ComposeViewFactoryTest.kt b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/ComposeViewFactoryTest.kt index 1b949076..d151ba46 100644 --- a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/ComposeViewFactoryTest.kt +++ b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/ComposeViewFactoryTest.kt @@ -20,10 +20,10 @@ import android.widget.FrameLayout import androidx.compose.foundation.layout.Column import androidx.compose.foundation.text.BasicText import androidx.compose.runtime.mutableStateOf +import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.viewinterop.AndroidView import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.ui.test.createComposeRule import com.squareup.workflow.ui.ViewEnvironment import com.squareup.workflow.ui.ViewRegistry import com.squareup.workflow.ui.WorkflowViewStub diff --git a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/CompositionRootTest.kt b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/CompositionRootTest.kt index c9ffaeec..2041c651 100644 --- a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/CompositionRootTest.kt +++ b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/CompositionRootTest.kt @@ -21,7 +21,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.onNodeWithText import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.ui.test.createComposeRule +import androidx.compose.ui.test.junit4.createComposeRule import com.google.common.truth.Truth.assertThat import org.junit.Rule import org.junit.Test diff --git a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/RenderAsStateTest.kt b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/RenderAsStateTest.kt index 21723b7f..683d616c 100644 --- a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/RenderAsStateTest.kt +++ b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/RenderAsStateTest.kt @@ -19,10 +19,10 @@ package com.squareup.workflow.ui.compose import androidx.compose.runtime.Providers import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.savedinstancestate.AmbientUiSavedStateRegistry import androidx.compose.runtime.savedinstancestate.UiSavedStateRegistry -import androidx.compose.runtime.savedinstancestate.UiSavedStateRegistryAmbient import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.ui.test.createComposeRule +import androidx.compose.ui.test.junit4.createComposeRule import com.google.common.truth.Truth.assertThat import com.squareup.workflow.RenderContext import com.squareup.workflow.Snapshot @@ -103,7 +103,7 @@ class RenderAsStateTest { lateinit var rendering: SnapshottedRendering composeRule.setContent { - Providers(UiSavedStateRegistryAmbient provides savedStateRegistry) { + Providers(AmbientUiSavedStateRegistry provides savedStateRegistry) { rendering = renderAsStateImpl( workflow, props = Unit, @@ -134,7 +134,7 @@ class RenderAsStateTest { lateinit var rendering: SnapshottedRendering composeRule.setContent { - Providers(UiSavedStateRegistryAmbient provides savedStateRegistry) { + Providers(AmbientUiSavedStateRegistry provides savedStateRegistry) { rendering = renderAsStateImpl( workflow, props = Unit, diff --git a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/ViewEnvironmentsTest.kt b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/ViewEnvironmentsTest.kt index 23285053..a15e32be 100644 --- a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/ViewEnvironmentsTest.kt +++ b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/ViewEnvironmentsTest.kt @@ -20,7 +20,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.onNodeWithText import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.ui.test.createComposeRule +import androidx.compose.ui.test.junit4.createComposeRule import com.squareup.workflow.ui.ViewEnvironment import com.squareup.workflow.ui.ViewRegistry import org.junit.Rule diff --git a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/WorkflowContainerTest.kt b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/WorkflowContainerTest.kt index 85f1dedc..6966a9a6 100644 --- a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/WorkflowContainerTest.kt +++ b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/WorkflowContainerTest.kt @@ -21,7 +21,7 @@ import androidx.compose.foundation.text.BasicText import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.onNodeWithText import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.ui.test.createComposeRule +import androidx.compose.ui.test.junit4.createComposeRule import com.squareup.workflow.Workflow import com.squareup.workflow.stateless import com.squareup.workflow.ui.ViewEnvironment diff --git a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/internal/ViewFactoriesTest.kt b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/internal/ViewFactoriesTest.kt index abfb5070..ecf9c988 100644 --- a/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/internal/ViewFactoriesTest.kt +++ b/core-compose/src/androidTest/java/com/squareup/workflow/ui/compose/internal/ViewFactoriesTest.kt @@ -29,7 +29,7 @@ import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.matcher.ViewMatchers.isDisplayed import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.ui.test.createComposeRule +import androidx.compose.ui.test.junit4.createComposeRule import com.squareup.workflow.ui.ViewEnvironment import com.squareup.workflow.ui.ViewFactory import com.squareup.workflow.ui.ViewRegistry diff --git a/samples/src/main/java/com/squareup/sample/hellocompose/App.kt b/samples/src/main/java/com/squareup/sample/hellocompose/App.kt index 8b54d4ef..22fcccb6 100644 --- a/samples/src/main/java/com/squareup/sample/hellocompose/App.kt +++ b/samples/src/main/java/com/squareup/sample/hellocompose/App.kt @@ -22,7 +22,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp -import androidx.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.Preview import com.squareup.workflow.diagnostic.SimpleLoggingDiagnosticListener import com.squareup.workflow.ui.ViewEnvironment import com.squareup.workflow.ui.ViewRegistry diff --git a/samples/src/main/java/com/squareup/sample/hellocomposebinding/HelloBinding.kt b/samples/src/main/java/com/squareup/sample/hellocomposebinding/HelloBinding.kt index 9119e0b5..8090d18d 100644 --- a/samples/src/main/java/com/squareup/sample/hellocomposebinding/HelloBinding.kt +++ b/samples/src/main/java/com/squareup/sample/hellocomposebinding/HelloBinding.kt @@ -22,7 +22,7 @@ import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.Preview import com.squareup.sample.hellocomposebinding.HelloWorkflow.Rendering import com.squareup.workflow.ui.compose.composedViewFactory import com.squareup.workflow.ui.compose.tooling.preview diff --git a/samples/src/main/java/com/squareup/sample/hellocomposerendering/HelloRenderingWorkflow.kt b/samples/src/main/java/com/squareup/sample/hellocomposerendering/HelloRenderingWorkflow.kt index 8d7b794c..04edcf1b 100644 --- a/samples/src/main/java/com/squareup/sample/hellocomposerendering/HelloRenderingWorkflow.kt +++ b/samples/src/main/java/com/squareup/sample/hellocomposerendering/HelloRenderingWorkflow.kt @@ -23,7 +23,7 @@ import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.Preview import com.squareup.sample.hellocomposerendering.HelloRenderingWorkflow.Toggle import com.squareup.workflow.Sink import com.squareup.workflow.ui.ViewEnvironment diff --git a/samples/src/main/java/com/squareup/sample/launcher/SampleLauncherApp.kt b/samples/src/main/java/com/squareup/sample/launcher/SampleLauncherApp.kt index 6800aae5..e04549f0 100644 --- a/samples/src/main/java/com/squareup/sample/launcher/SampleLauncherApp.kt +++ b/samples/src/main/java/com/squareup/sample/launcher/SampleLauncherApp.kt @@ -23,7 +23,7 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width -import androidx.compose.foundation.lazy.LazyColumnFor +import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material.ListItem import androidx.compose.material.MaterialTheme import androidx.compose.material.Scaffold @@ -35,21 +35,21 @@ import androidx.compose.material.lightColors import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Modifier -import androidx.compose.ui.drawLayer import androidx.compose.ui.geometry.Rect import androidx.compose.ui.gesture.rawPressStartGestureFilter +import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.input.pointer.PointerEventPass.Initial import androidx.compose.ui.layout.LayoutCoordinates import androidx.compose.ui.layout.globalBounds import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.node.Ref -import androidx.compose.ui.platform.ConfigurationAmbient -import androidx.compose.ui.platform.ViewAmbient +import androidx.compose.ui.platform.AmbientConfiguration +import androidx.compose.ui.platform.AmbientView import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.core.app.ActivityOptionsCompat.makeScaleUpAnimation import androidx.core.content.ContextCompat.startActivity -import androidx.ui.tooling.preview.Preview import com.squareup.sample.R.string @Composable fun SampleLauncherApp() { @@ -61,8 +61,10 @@ import com.squareup.sample.R.string }) } ) { - LazyColumnFor(samples) { sample -> - SampleItem(sample) + LazyColumn { + items(samples) { sample -> + SampleItem(sample) + } } } } @@ -73,7 +75,7 @@ import com.squareup.sample.R.string } @Composable private fun SampleItem(sample: Sample) { - val rootView = ViewAmbient.current + val rootView = AmbientView.current /** * [androidx.compose.ui.layout.LayoutCoordinates.globalBounds] corresponds to the coordinates in @@ -95,7 +97,7 @@ import com.squareup.sample.R.string sample: Sample, onPreviewCoordinates: (LayoutCoordinates) -> Unit ) { - val configuration = ConfigurationAmbient.current + val configuration = AmbientConfiguration.current val screenRatio = configuration.screenWidthDp.toFloat() / configuration.screenHeightDp.toFloat() // 88dp is taken from ListItem implementation. This doesn't seem to be coming in via any // constraints as of dev11. @@ -126,7 +128,7 @@ import com.squareup.sample.R.string // correctly too. .height(configuration.screenHeightDp.dp) .width(configuration.screenWidthDp.dp) - .drawLayer(scaleX = scale, scaleY = scale) + .graphicsLayer(scaleX = scale, scaleY = scale) ) { sample.preview() } diff --git a/samples/src/main/java/com/squareup/sample/nestedrenderings/LegacyRunner.kt b/samples/src/main/java/com/squareup/sample/nestedrenderings/LegacyRunner.kt index e898a467..6f0a253b 100644 --- a/samples/src/main/java/com/squareup/sample/nestedrenderings/LegacyRunner.kt +++ b/samples/src/main/java/com/squareup/sample/nestedrenderings/LegacyRunner.kt @@ -18,7 +18,7 @@ package com.squareup.sample.nestedrenderings import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.Preview import com.squareup.sample.databinding.LegacyViewBinding import com.squareup.sample.nestedrenderings.RecursiveWorkflow.LegacyRendering import com.squareup.workflow.ui.LayoutRunner diff --git a/samples/src/main/java/com/squareup/sample/nestedrenderings/NestedRenderingsActivity.kt b/samples/src/main/java/com/squareup/sample/nestedrenderings/NestedRenderingsActivity.kt index c624c2e5..d1bb8859 100644 --- a/samples/src/main/java/com/squareup/sample/nestedrenderings/NestedRenderingsActivity.kt +++ b/samples/src/main/java/com/squareup/sample/nestedrenderings/NestedRenderingsActivity.kt @@ -32,7 +32,7 @@ private val viewRegistry = ViewRegistry( ) private val viewEnvironment = ViewEnvironment(viewRegistry).withCompositionRoot { content -> - Providers(BackgroundColorAmbient provides Color.Green, children = content) + Providers(AmbientBackgroundColor provides Color.Green, content = content) } class NestedRenderingsActivity : AppCompatActivity() { diff --git a/samples/src/main/java/com/squareup/sample/nestedrenderings/RecursiveViewFactory.kt b/samples/src/main/java/com/squareup/sample/nestedrenderings/RecursiveViewFactory.kt index e6a47c5c..72c575c6 100644 --- a/samples/src/main/java/com/squareup/sample/nestedrenderings/RecursiveViewFactory.kt +++ b/samples/src/main/java/com/squareup/sample/nestedrenderings/RecursiveViewFactory.kt @@ -17,7 +17,6 @@ package com.squareup.sample.nestedrenderings -import androidx.compose.material.Text import androidx.compose.foundation.layout.Arrangement.SpaceEvenly import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ExperimentalLayout @@ -28,6 +27,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.material.Button import androidx.compose.material.Card +import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.Providers import androidx.compose.runtime.ambientOf @@ -37,7 +37,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.compositeOver import androidx.compose.ui.res.dimensionResource -import androidx.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.Preview import com.squareup.sample.R import com.squareup.sample.nestedrenderings.RecursiveWorkflow.Rendering import com.squareup.workflow.ui.ViewEnvironment @@ -48,14 +48,14 @@ import com.squareup.workflow.ui.compose.tooling.preview /** * Ambient of [Color] to use as the background color for a [RecursiveViewFactory]. */ -val BackgroundColorAmbient = ambientOf { error("No background color specified") } +val AmbientBackgroundColor = ambientOf { error("No background color specified") } /** * A `ViewFactory` that renders [RecursiveWorkflow.Rendering]s. */ val RecursiveViewFactory = composedViewFactory { rendering, viewEnvironment -> // Every child should be drawn with a slightly-darker background color. - val color = BackgroundColorAmbient.current + val color = AmbientBackgroundColor.current val childColor = remember(color) { color.copy(alpha = .9f) .compositeOver(Color.Black) @@ -67,7 +67,7 @@ val RecursiveViewFactory = composedViewFactory { rendering, viewEnvir .fillMaxSize(), horizontalAlignment = CenterHorizontally ) { - Providers(BackgroundColorAmbient provides childColor) { + Providers(AmbientBackgroundColor provides childColor) { Children( rendering.children, viewEnvironment, // Pass a weight so that the column fills all the space not occupied by the buttons. @@ -84,7 +84,7 @@ val RecursiveViewFactory = composedViewFactory { rendering, viewEnvir @Preview @Composable fun RecursiveViewFactoryPreview() { - Providers(BackgroundColorAmbient provides Color.Green) { + Providers(AmbientBackgroundColor provides Color.Green) { RecursiveViewFactory.preview( Rendering( children = listOf( diff --git a/samples/src/main/java/com/squareup/sample/textinput/App.kt b/samples/src/main/java/com/squareup/sample/textinput/App.kt index 5a0b21cb..00e83798 100644 --- a/samples/src/main/java/com/squareup/sample/textinput/App.kt +++ b/samples/src/main/java/com/squareup/sample/textinput/App.kt @@ -17,7 +17,7 @@ package com.squareup.sample.textinput import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable -import androidx.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.Preview import com.squareup.workflow.diagnostic.SimpleLoggingDiagnosticListener import com.squareup.workflow.ui.ViewEnvironment import com.squareup.workflow.ui.ViewRegistry diff --git a/samples/src/main/java/com/squareup/sample/textinput/TextInputViewFactory.kt b/samples/src/main/java/com/squareup/sample/textinput/TextInputViewFactory.kt index e1c10a1d..e943d7c2 100644 --- a/samples/src/main/java/com/squareup/sample/textinput/TextInputViewFactory.kt +++ b/samples/src/main/java/com/squareup/sample/textinput/TextInputViewFactory.kt @@ -16,7 +16,6 @@ package com.squareup.sample.textinput import androidx.compose.animation.animateContentSize -import androidx.compose.material.Text import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize @@ -24,17 +23,16 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.material.Button import androidx.compose.material.OutlinedTextField +import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.focus.ExperimentalFocus +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import androidx.ui.tooling.preview.Preview import com.squareup.sample.textinput.TextInputWorkflow.Rendering import com.squareup.workflow.ui.compose.composedViewFactory import com.squareup.workflow.ui.compose.tooling.preview -@OptIn(ExperimentalFocus::class) val TextInputViewFactory = composedViewFactory { rendering, _ -> Column( modifier = Modifier