WorkflowLayout
A view that can be driven by a stream of Screen renderings passed to its take method.
Suitable for use as the content view of an Activity, or androidx.fragment.app.Fragment.onCreateView.
id defaults to R.id.workflow_layout, as a convenience to ensure that view persistence will work without requiring authors to be immersed in Android arcana.
See com.squareup.workflow1.ui.renderWorkflowIn for typical use with a com.squareup.workflow1.Workflow.
Properties
Returns the most recent ViewEnvironment applied to this view, or null if the receiver was not initialized via ScreenViewHolder.startShowing.
Returns the most recent Screen rendering shown in this view, or throws a NullPointerException if the receiver was not created via ScreenViewFactory.startShowing.
Returns the most recent Screen rendering shown in this view, or null
if the receiver was not initialized via ScreenViewHolder.startShowing.
Functions
Returns the bounds of this View in the coordinate space of the device screen, based on View.getLocationOnScreen and its reported width and height.
Looks for a View's OnBackPressedDispatcherOwner via the usual findViewTreeOnBackPressedDispatcherOwner method, and if that fails checks its Context.
Wrapper for the two arg variant of setBackHandler, a convenience for the common pattern of using a nullable function as the back handler to indicate that back handling should be disabled.
A function to be called if the device back button is pressed while this view is active, as determined by its ViewTreeLifecycleOwner, via an OnBackPressedCallback. On succeeding calls, the previously created OnBackPressedCallback will be updated, and will maintain its position in the OnBackPressedDispatcher priority queue.