Skip to content

//workflow/com.squareup.workflow1.ui.container

Package com.squareup.workflow1.ui.container

Types

Name Summary
AlertDialogThemeResId [androidJvm]
Content
@WorkflowUiExperimentalApi()

object AlertDialogThemeResId : ViewEnvironmentKey<Int>
More info
The default OverlayDialogFactory for AlertOverlay reads this value for the @StyleRes themeResId: Int argument of AlertDialog.Builder().


AlertOverlay [jvm]
Content
@WorkflowUiExperimentalApi()

data class AlertOverlay(buttons: Map<AlertOverlay.Button, String>, message: String, title: String, cancelable: Boolean, onEvent: (AlertOverlay.Event) -> Unit) : Overlay
More info
Models a typical “You sure about that?” alert box.


AlertOverlayDialogFactory [androidJvm]
Content
@WorkflowUiExperimentalApi()

open class AlertOverlayDialogFactory : OverlayDialogFactory
More info
Default OverlayDialogFactory for AlertOverlay.


AndroidOverlay [androidJvm]
Content
@WorkflowUiExperimentalApi()

interface AndroidOverlay<O : AndroidOverlay<O>> : Overlay
More info
Interface implemented by a rendering class to allow it to drive an Android UI via an appropriate OverlayDialogFactory implementation.


BackButtonScreen [androidJvm]
Content
@WorkflowUiExperimentalApi()

class BackButtonScreen<W : Screen>(wrapped: W, shadow: Boolean, onBackPressed: () -> Unit?) : AndroidScreen<BackButtonScreen<W>>
More info
Adds optional back button handling to a wrapped rendering, possibly overriding that the wrapped rendering’s own back button handler.


BackStackConfig [androidJvm]
Content
@WorkflowUiExperimentalApi()

enum BackStackConfig : Enum<BackStackConfig>
More info
Informs views whether they’re children of a BackStackContainer, and if so whether they’re the first frame or not.


BackStackContainer [androidJvm]
Content
@WorkflowUiExperimentalApi()

open class BackStackContainer@JvmOverloads()constructor(context: Context, attributeSet: AttributeSet?, defStyle: Int, defStyleRes: Int) : FrameLayout
More info
A container view that can display a stream of BackStackScreen instances.


BackStackScreen [jvm]
Content
@WorkflowUiExperimentalApi()

class BackStackScreen<StackedT : Screen>(bottom: StackedT, rest: List<StackedT>) : Screen
More info
Represents an active screen (top), and a set of previously visited screens to which we may return (backStack).


BodyAndModalsScreen [jvm]
Content
@WorkflowUiExperimentalApi()

class BodyAndModalsScreen<B : Screen, M : Overlay>(body: B, modals: List<M>) : Screen
More info
A screen that may stack a number of modal Overlays over a body.


EnvironmentScreen [jvm]
Content
@WorkflowUiExperimentalApi()

class EnvironmentScreen<V : Screen>(wrapped: V, environment: ViewEnvironment) : Compatible, Screen
More info
Pairs a wrapped rendering with a environment to support its display.


LayeredDialogs [androidJvm]
Content
@WorkflowUiExperimentalApi()

class LayeredDialogs(context: Context, modal: Boolean, getParentLifecycleOwner: () -> LifecycleOwner)
More info
Does the bulk of the work of maintaining a set of Dialogs to reflect lists of Overlay.


ModalScreenOverlay [jvm]
Content
@WorkflowUiExperimentalApi()

class ModalScreenOverlay<ContentT : Screen>(content: ContentT) : ScreenOverlay<ContentT>
More info
A basic ScreenOverlay that fills all available space.


ModalScreenOverlayDialogFactory [androidJvm]
Content
@WorkflowUiExperimentalApi()

open class ModalScreenOverlayDialogFactory<O : ScreenOverlay<>>(**type*: KClassO>) : OverlayDialogFactory<O>
More info
Default OverlayDialogFactory for ModalScreenOverlay.


ModalScreenOverlayOnBackPressed [androidJvm]
Content
@WorkflowUiExperimentalApi()

fun fun interface ModalScreenOverlayOnBackPressed
More info
The function called to handle back button events in Dialogs built by ModalScreenOverlayDialogFactory.


Overlay [jvm]
Content
@WorkflowUiExperimentalApi()

interface Overlay
More info
Marker interface implemented by window-like renderings that map to a layer above a base Screen.


OverlayDialogFactory [androidJvm]
Content
@WorkflowUiExperimentalApi()

interface OverlayDialogFactory<RenderingT : Overlay> : ViewRegistry.Entry<RenderingT>
More info
Factory for Dialog instances that can show renderings of type RenderingT : Overlay.


OverlayDialogFactoryFinder [androidJvm]
Content
@WorkflowUiExperimentalApi()

interface OverlayDialogFactoryFinder
More info
ViewEnvironment service object used by Overlay.toDialogFactory to find the right OverlayDialogFactoryScreenViewFactory.


ScreenOverlay [jvm]
Content
@WorkflowUiExperimentalApi()

interface ScreenOverlay<ContentT : Screen> : Overlay, Compatible
More info
An Overlay built around a root content.


ViewStateCache [androidJvm]
Content
@WorkflowUiExperimentalApi()

class ViewStateCache
More info
Handles persistence chores for container views that manage a set of NamedScreen renderings, showing a view for one at a time – think back stacks or tab sets.


Functions

Name Summary
plus [androidJvm]
Content
@WorkflowUiExperimentalApi()

operator fun ViewEnvironment.plus(config: BackStackConfig): ViewEnvironment
@WorkflowUiExperimentalApi()

operator fun ViewEnvironment.plus(onBackPressed: ModalScreenOverlayOnBackPressed): ViewEnvironment


setBounds [androidJvm]
Content
@WorkflowUiExperimentalApi()

fun Dialog.setBounds(bounds: Rect)
More info
Updates the size of the Window of the receiving Dialog.


setModalContent [androidJvm]
Content
fun Dialog.setModalContent(contentView: View)
More info
The default implementation of ModalScreenOverlayDialogFactory.buildDialogWithContentView.


toBackStackScreen [jvm]
Content
@WorkflowUiExperimentalApi()

fun <T : Screen> List<T>.toBackStackScreen(): BackStackScreen<T>


toBackStackScreenOrNull [jvm]
Content
@WorkflowUiExperimentalApi()

fun <T : Screen> List<T>.toBackStackScreenOrNull(): BackStackScreen<T>?


toDialogFactory [androidJvm]
Content
@WorkflowUiExperimentalApi()

fun <T : Overlay> T.toDialogFactory(environment: ViewEnvironment): OverlayDialogFactory<T>


withEnvironment [jvm]
Content
@WorkflowUiExperimentalApi()

fun Screen.withEnvironment(environment: ViewEnvironment = ViewEnvironment.EMPTY): EnvironmentScreen<*>
More info
Returns an EnvironmentScreen derived from the receiver, whose EnvironmentScreen.environment includes the values in the given environment.


withRegistry [jvm]
Content
@WorkflowUiExperimentalApi()

fun Screen.withRegistry(viewRegistry: ViewRegistry): EnvironmentScreen<*>
More info
Returns an EnvironmentScreen derived from the receiver, whose EnvironmentScreen.environment includes viewRegistry.