Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android.useAndroidX=true
systemProp.org.gradle.internal.publish.checksums.insecure=true

GROUP=com.squareup.workflow1
VERSION_NAME=1.8.0-uiUpdate01-SNAPSHOT
VERSION_NAME=1.8.0-uiUpdate02-SNAPSHOT

POM_DESCRIPTION=Square Workflow

Expand Down
7 changes: 7 additions & 0 deletions workflow-ui/core-android/api/core-android.api
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,13 @@ public final class com/squareup/workflow1/ui/container/DispatchCancelEventKt {
public static final fun dispatchCancelEvent (Lkotlin/jvm/functions/Function1;)V
}

public final class com/squareup/workflow1/ui/container/EnvironmentScreenLegacyViewFactory : com/squareup/workflow1/ui/ViewFactory {
public static final field INSTANCE Lcom/squareup/workflow1/ui/container/EnvironmentScreenLegacyViewFactory;
public fun buildView (Lcom/squareup/workflow1/ui/container/EnvironmentScreen;Lcom/squareup/workflow1/ui/ViewEnvironment;Landroid/content/Context;Landroid/view/ViewGroup;)Landroid/view/View;
public synthetic fun buildView (Ljava/lang/Object;Lcom/squareup/workflow1/ui/ViewEnvironment;Landroid/content/Context;Landroid/view/ViewGroup;)Landroid/view/View;
public fun getType ()Lkotlin/reflect/KClass;
}

public final class com/squareup/workflow1/ui/container/EnvironmentScreenViewFactoryKt {
public static final fun EnvironmentScreenViewFactory ()Lcom/squareup/workflow1/ui/ScreenViewFactory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import android.content.Context
import android.view.View
import android.view.ViewGroup
import com.squareup.workflow1.ui.container.BackStackScreen
import com.squareup.workflow1.ui.container.EnvironmentScreen
import com.squareup.workflow1.ui.container.EnvironmentScreenLegacyViewFactory
import kotlin.reflect.KClass

@Deprecated("Use ScreenViewFactoryFinder.getViewFactoryForRendering()")
Expand All @@ -20,6 +22,9 @@ public fun <RenderingT : Any> ViewRegistry.getFactoryForRendering(
?: (rendering as? BackStackScreen<*>)?.let {
BackStackScreenLegacyViewFactory as ViewFactory<RenderingT>
}
?: (rendering as? EnvironmentScreen<*>)?.let {
EnvironmentScreenLegacyViewFactory as ViewFactory<RenderingT>
}
?: (rendering as? Named<*>)?.let { NamedViewFactory as ViewFactory<RenderingT> }
?: throw IllegalArgumentException(
"A ViewFactory should have been registered to display $rendering, " +
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@file:Suppress("DEPRECATION")

package com.squareup.workflow1.ui.container

import com.squareup.workflow1.ui.DecorativeViewFactory
import com.squareup.workflow1.ui.ViewFactory
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
import com.squareup.workflow1.ui.merge

@Suppress("DEPRECATION")
@WorkflowUiExperimentalApi
internal object EnvironmentScreenLegacyViewFactory : ViewFactory<EnvironmentScreen<*>>
by DecorativeViewFactory(
type = EnvironmentScreen::class,
map = { environmentScreen, inheritedEnvironment ->
Pair(environmentScreen.wrapped, environmentScreen.environment merge inheritedEnvironment)
}
)